1 Index: linux-2.6.21.7/include/linux/ip.h
2 ===================================================================
3 --- linux-2.6.21.7.orig/include/linux/ip.h
4 +++ linux-2.6.21.7/include/linux/ip.h
5 @@ -104,6 +104,16 @@ struct iphdr {
6 /*The options start here. */
10 +#include <linux/skbuff.h>
12 +static inline struct iphdr *ip_hdr(const struct sk_buff *skb)
14 + return (struct iphdr *)skb_network_header(skb);
21 __u8 hdrlen; /* This one is measured in 32 bit units! */
22 Index: linux-2.6.21.7/include/linux/skbuff.h
23 ===================================================================
24 --- linux-2.6.21.7.orig/include/linux/skbuff.h
25 +++ linux-2.6.21.7/include/linux/skbuff.h
26 @@ -966,6 +966,16 @@ static inline void skb_reserve(struct sk
30 +static inline unsigned char *skb_network_header(const struct sk_buff *skb)
35 +static inline unsigned char *skb_tail_pointer(const struct sk_buff *skb)
41 * CPUs often take a performance hit when accessing unaligned memory
42 * locations. The actual performance hit varies, it can be small if the
43 Index: linux-2.6.21.7/include/net/ip.h
44 ===================================================================
45 --- linux-2.6.21.7.orig/include/net/ip.h
46 +++ linux-2.6.21.7/include/net/ip.h
47 @@ -43,6 +43,11 @@ struct inet_skb_parm
48 #define IPSKB_REROUTED 16
51 +static inline unsigned int ip_hdrlen(const struct sk_buff *skb)
53 + return ip_hdr(skb)->ihl * 4;