Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 261831 Details for
Bug 385681
Backport upstream sk_buff and ip/tcp header functions to rhel5
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
rhel5-test0.patch
385681.patch (text/plain), 7.35 KB, created by
Andy Gospodarek
on 2007-11-16 21:34:33 UTC
(
hide
)
Description:
rhel5-test0.patch
Filename:
MIME Type:
Creator:
Andy Gospodarek
Created:
2007-11-16 21:34:33 UTC
Size:
7.35 KB
patch
obsolete
>diff -up linux-2.6.18.i386/include/net/ip.h.385681 linux-2.6.18.i386/include/net/ip.h >--- linux-2.6.18.i386/include/net/ip.h.385681 2006-09-19 23:42:06.000000000 -0400 >+++ linux-2.6.18.i386/include/net/ip.h 2007-11-16 16:20:39.000000000 -0500 >@@ -25,6 +25,7 @@ > #include <linux/types.h> > #include <linux/ip.h> > #include <linux/in.h> >+#include <linux/skbuff.h> > > #include <net/inet_sock.h> > #include <net/snmp.h> >@@ -43,6 +44,11 @@ struct inet_skb_parm > #define IPSKB_REROUTED 16 > }; > >+static inline unsigned int ip_hdrlen(const struct sk_buff *skb) >+{ >+ return skb->nh.iph->ihl * 4; >+} >+ > struct ipcm_cookie > { > u32 addr; >diff -up linux-2.6.18.i386/include/linux/tcp.h.385681 linux-2.6.18.i386/include/linux/tcp.h >--- linux-2.6.18.i386/include/linux/tcp.h.385681 2006-09-19 23:42:06.000000000 -0400 >+++ linux-2.6.18.i386/include/linux/tcp.h 2007-11-16 15:38:24.000000000 -0500 >@@ -165,6 +165,21 @@ struct tcp_info > #include <net/inet_connection_sock.h> > #include <net/inet_timewait_sock.h> > >+static inline struct tcphdr *tcp_hdr(const struct sk_buff *skb) >+{ >+ return (struct tcphdr *)skb_transport_header(skb); >+} >+ >+static inline unsigned int tcp_hdrlen(const struct sk_buff *skb) >+{ >+ return tcp_hdr(skb)->doff * 4; >+} >+ >+static inline unsigned int tcp_optlen(const struct sk_buff *skb) >+{ >+ return (tcp_hdr(skb)->doff - 5) * 4; >+} >+ > /* This defines a selective acknowledgement block. */ > struct tcp_sack_block { > __u32 start_seq; >diff -up linux-2.6.18.i386/include/linux/if_arp.h.385681 linux-2.6.18.i386/include/linux/if_arp.h >--- linux-2.6.18.i386/include/linux/if_arp.h.385681 2006-09-19 23:42:06.000000000 -0400 >+++ linux-2.6.18.i386/include/linux/if_arp.h 2007-11-16 15:38:24.000000000 -0500 >@@ -148,4 +148,13 @@ struct arphdr > > }; > >+#ifdef __KERNEL__ >+#include <linux/skbuff.h> >+ >+static inline struct arphdr *arp_hdr(const struct sk_buff *skb) >+{ >+ return (struct arphdr *)skb_network_header(skb); >+} >+#endif >+ > #endif /* _LINUX_IF_ARP_H */ >diff -up linux-2.6.18.i386/include/linux/icmp.h.385681 linux-2.6.18.i386/include/linux/icmp.h >--- linux-2.6.18.i386/include/linux/icmp.h.385681 2006-09-19 23:42:06.000000000 -0400 >+++ linux-2.6.18.i386/include/linux/icmp.h 2007-11-16 15:38:24.000000000 -0500 >@@ -82,6 +82,15 @@ struct icmphdr { > } un; > }; > >+#ifdef __KERNEL__ >+#include <linux/skbuff.h> >+ >+static inline struct icmphdr *icmp_hdr(const struct sk_buff *skb) >+{ >+ return (struct icmphdr *)skb_transport_header(skb); >+} >+#endif >+ > /* > * constants for (set|get)sockopt > */ >diff -up linux-2.6.18.i386/include/linux/udp.h.385681 linux-2.6.18.i386/include/linux/udp.h >--- linux-2.6.18.i386/include/linux/udp.h.385681 2006-09-19 23:42:06.000000000 -0400 >+++ linux-2.6.18.i386/include/linux/udp.h 2007-11-16 15:38:24.000000000 -0500 >@@ -26,6 +26,15 @@ struct udphdr { > __u16 check; > }; > >+#ifdef __KERNEL__ >+#include <linux/skbuff.h> >+ >+static inline struct udphdr *udp_hdr(const struct sk_buff *skb) >+{ >+ return (struct udphdr *)skb_transport_header(skb); >+} >+#endif >+ > /* UDP socket options */ > #define UDP_CORK 1 /* Never send partially complete segments */ > #define UDP_ENCAP 100 /* Set the socket to accept encapsulated packets */ >diff -up linux-2.6.18.i386/include/linux/skbuff.h.385681 linux-2.6.18.i386/include/linux/skbuff.h >--- linux-2.6.18.i386/include/linux/skbuff.h.385681 2007-11-16 15:35:14.000000000 -0500 >+++ linux-2.6.18.i386/include/linux/skbuff.h 2007-11-16 15:38:24.000000000 -0500 >@@ -966,6 +966,72 @@ static inline void skb_reserve(struct sk > skb->tail += len; > } > >+static inline unsigned char *skb_transport_header(const struct sk_buff *skb) >+{ >+ return skb->h.raw; >+} >+ >+static inline void skb_reset_transport_header(struct sk_buff *skb) >+{ >+ skb->h.raw = skb->data; >+} >+ >+static inline void skb_set_transport_header(struct sk_buff *skb, >+ const int offset) >+{ >+ skb->h.raw = skb->data + offset; >+} >+ >+static inline int skb_transport_offset(const struct sk_buff *skb) >+{ >+ return skb->h.raw - skb->data; >+} >+ >+static inline unsigned char *skb_network_header(const struct sk_buff *skb) >+{ >+ return skb->nh.raw; >+} >+ >+static inline void skb_reset_network_header(struct sk_buff *skb) >+{ >+ skb->nh.raw = skb->data; >+} >+ >+static inline void skb_set_network_header(struct sk_buff *skb, const int offset) >+{ >+ skb->nh.raw = skb->data + offset; >+} >+ >+static inline int skb_network_offset(const struct sk_buff *skb) >+{ >+ return skb->nh.raw - skb->data; >+} >+ >+static inline u32 skb_network_header_len(const struct sk_buff *skb) >+{ >+ return skb->h.raw - skb->nh.raw; >+} >+ >+static inline unsigned char *skb_mac_header(const struct sk_buff *skb) >+{ >+ return skb->mac.raw; >+} >+ >+static inline int skb_mac_header_was_set(const struct sk_buff *skb) >+{ >+ return skb->mac.raw != NULL; >+} >+ >+static inline void skb_reset_mac_header(struct sk_buff *skb) >+{ >+ skb->mac.raw = skb->data; >+} >+ >+static inline void skb_set_mac_header(struct sk_buff *skb, const int offset) >+{ >+ skb->mac.raw = skb->data + offset; >+} >+ > /* > * CPUs often take a performance hit when accessing unaligned memory > * locations. The actual performance hit varies, it can be small if the >diff -up linux-2.6.18.i386/include/linux/igmp.h.385681 linux-2.6.18.i386/include/linux/igmp.h >--- linux-2.6.18.i386/include/linux/igmp.h.385681 2007-11-16 15:35:12.000000000 -0500 >+++ linux-2.6.18.i386/include/linux/igmp.h 2007-11-16 15:38:24.000000000 -0500 >@@ -80,6 +80,27 @@ struct igmpv3_query { > __u32 srcs[0]; > }; > >+#ifdef __KERNEL__ >+#include <linux/skbuff.h> >+ >+static inline struct igmphdr *igmp_hdr(const struct sk_buff *skb) >+{ >+ return (struct igmphdr *)skb_transport_header(skb); >+} >+ >+static inline struct igmpv3_report * >+ igmpv3_report_hdr(const struct sk_buff *skb) >+{ >+ return (struct igmpv3_report *)skb_transport_header(skb); >+} >+ >+static inline struct igmpv3_query * >+ igmpv3_query_hdr(const struct sk_buff *skb) >+{ >+ return (struct igmpv3_query *)skb_transport_header(skb); >+} >+#endif >+ > #define IGMP_HOST_MEMBERSHIP_QUERY 0x11 /* From RFC1112 */ > #define IGMP_HOST_MEMBERSHIP_REPORT 0x12 /* Ditto */ > #define IGMP_DVMRP 0x13 /* DVMRP routing */ >diff -up linux-2.6.18.i386/include/linux/ip.h.385681 linux-2.6.18.i386/include/linux/ip.h >--- linux-2.6.18.i386/include/linux/ip.h.385681 2007-11-16 15:34:28.000000000 -0500 >+++ linux-2.6.18.i386/include/linux/ip.h 2007-11-16 15:38:24.000000000 -0500 >@@ -102,6 +102,20 @@ struct iphdr { > /*The options start here. */ > }; > >+#ifdef __KERNEL__ >+#include <linux/skbuff.h> >+ >+static inline struct iphdr *ip_hdr(const struct sk_buff *skb) >+{ >+ return (struct iphdr *)skb_network_header(skb); >+} >+ >+static inline struct iphdr *ipip_hdr(const struct sk_buff *skb) >+{ >+ return (struct iphdr *)skb_transport_header(skb); >+} >+#endif >+ > struct ip_auth_hdr { > __u8 nexthdr; > __u8 hdrlen; /* This one is measured in 32 bit units! */ >diff -up linux-2.6.18.i386/include/linux/ipv6.h.385681 linux-2.6.18.i386/include/linux/ipv6.h >--- linux-2.6.18.i386/include/linux/ipv6.h.385681 2007-11-16 15:34:44.000000000 -0500 >+++ linux-2.6.18.i386/include/linux/ipv6.h 2007-11-16 15:38:24.000000000 -0500 >@@ -191,6 +191,16 @@ enum { > #include <net/if_inet6.h> /* struct ipv6_mc_socklist */ > #include <net/inet_sock.h> > >+static inline struct ipv6hdr *ipv6_hdr(const struct sk_buff *skb) >+{ >+ return (struct ipv6hdr *)skb_network_header(skb); >+} >+ >+static inline struct ipv6hdr *ipipv6_hdr(const struct sk_buff *skb) >+{ >+ return (struct ipv6hdr *)skb_transport_header(skb); >+} >+ > /* > This structure contains results of exthdrs parsing > as offsets from skb->nh.
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 385681
: 261831