]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
[SK_BUFF]: Introduce ipip_hdr(), remove skb->h.ipiph
authorArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 26 Apr 2007 01:02:22 +0000 (18:02 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Thu, 26 Apr 2007 05:25:27 +0000 (22:25 -0700)
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/sk98lin/skge.c
drivers/net/skge.c
include/linux/ip.h
include/linux/skbuff.h
net/ipv4/xfrm4_mode_beet.c
net/ipv4/xfrm4_mode_tunnel.c
net/ipv6/xfrm6_mode_tunnel.c

index e4ab7a8acc1af466b29a793ade99a93034e0e2f0..b987a5c3f42a31c8b1aafe3d4d489c7a29aba3b3 100644 (file)
@@ -1565,7 +1565,7 @@ struct sk_buff    *pMessage)      /* pointer to send-message              */
                u16 hdrlen = skb_transport_offset(pMessage);
                u16 offset = hdrlen + pMessage->csum_offset;
 
-               if ((pMessage->h.ipiph->protocol == IPPROTO_UDP ) &&
+               if ((ipip_hdr(pMessage)->protocol == IPPROTO_UDP) &&
                        (pAC->GIni.GIChipRev == 0) &&
                        (pAC->GIni.GIChipId == CHIP_ID_YUKON)) {
                        pTxd->TBControl = BMU_TCP_CHECK;
@@ -1691,7 +1691,7 @@ struct sk_buff    *pMessage)      /* pointer to send-message              */
                ** opcode for udp is not working in the hardware yet 
                ** (Revision 2.0)
                */
-               if ((pMessage->h.ipiph->protocol == IPPROTO_UDP ) &&
+               if ((ipip_hdr(pMessage)->protocol == IPPROTO_UDP) &&
                        (pAC->GIni.GIChipRev == 0) &&
                        (pAC->GIni.GIChipId == CHIP_ID_YUKON)) {
                        Control |= BMU_TCP_CHECK;
index ca7a0e0398496d723a0139a99164e468e5143445..99b61cfb7ce669b85057b607444f2032fe292058 100644 (file)
@@ -2659,7 +2659,7 @@ static int skge_xmit_frame(struct sk_buff *skb, struct net_device *dev)
                /* This seems backwards, but it is what the sk98lin
                 * does.  Looks like hardware is wrong?
                 */
-               if (skb->h.ipiph->protocol == IPPROTO_UDP
+               if (ipip_hdr(skb)->protocol == IPPROTO_UDP
                    && hw->chip_rev == 0 && hw->chip_id == CHIP_ID_YUKON)
                        control = BMU_TCP_CHECK;
                else
index f2f26db16f5718d6762b4be31c353c5e376485d3..19578440b5fcdaf5f9c05e4fff51530e3e7c2ee6 100644 (file)
@@ -111,6 +111,11 @@ 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->h.raw;
+}
 #endif
 
 struct ip_auth_hdr {
index 8f158d66d2a8993e9f409d6904ec98e2eaeac93f..862a81cf7f7415f54cb450437fcdf1f6a9875e07 100644 (file)
@@ -237,7 +237,6 @@ struct sk_buff {
        /* 4 byte hole on 64 bit*/
 
        union {
-               struct iphdr    *ipiph;
                struct ipv6hdr  *ipv6h;
                unsigned char   *raw;
        } h;
index 9e5ba12c6c7529158da629919893fe9e72a97543..32fcfc0b5c8c10d6a5a8e9a954b33592523c8601 100644 (file)
@@ -83,7 +83,7 @@ static int xfrm4_beet_input(struct xfrm_state *x, struct sk_buff *skb)
 
                if (!pskb_may_pull(skb, sizeof(*ph)))
                        goto out;
-               ph = (struct ip_beet_phdr *)(skb->h.ipiph + 1);
+               ph = (struct ip_beet_phdr *)(ipip_hdr(skb) + 1);
 
                phlen = sizeof(*ph) + ph->padlen;
                optlen = ph->hdrlen * 8 + (IPV4_BEET_PHMAXLEN - phlen);
@@ -97,9 +97,9 @@ static int xfrm4_beet_input(struct xfrm_state *x, struct sk_buff *skb)
                ph_nexthdr = ph->nexthdr;
        }
 
-       skb->nh.raw = skb->data + (phlen - sizeof(*iph));
+       skb_set_network_header(skb, phlen - sizeof(*iph));
        memmove(skb_network_header(skb), iph, sizeof(*iph));
-       skb->h.raw = skb->data + (phlen + optlen);
+       skb_set_transport_header(skb, phlen + optlen);
        skb->data = skb->h.raw;
 
        iph = ip_hdr(skb);
index edba75610a4620d51c5d495172992a5998c87154..521e52f055c118ac87cee35c7de1313333755fce 100644 (file)
@@ -17,7 +17,7 @@
 static inline void ipip_ecn_decapsulate(struct sk_buff *skb)
 {
        struct iphdr *outer_iph = ip_hdr(skb);
-       struct iphdr *inner_iph = skb->h.ipiph;
+       struct iphdr *inner_iph = ipip_hdr(skb);
 
        if (INET_ECN_is_ce(outer_iph->tos))
                IP_ECN_set_ce(inner_iph);
@@ -47,7 +47,7 @@ static int xfrm4_tunnel_output(struct xfrm_state *x, struct sk_buff *skb)
        int flags;
 
        iph = ip_hdr(skb);
-       skb->h.ipiph = iph;
+       skb->h.raw = skb->nh.raw;
 
        skb_push(skb, x->props.header_len);
        skb_reset_network_header(skb);
@@ -116,7 +116,7 @@ static int xfrm4_tunnel_input(struct xfrm_state *x, struct sk_buff *skb)
        iph = ip_hdr(skb);
        if (iph->protocol == IPPROTO_IPIP) {
                if (x->props.flags & XFRM_STATE_DECAP_DSCP)
-                       ipv4_copy_dscp(iph, skb->h.ipiph);
+                       ipv4_copy_dscp(iph, ipip_hdr(skb));
                if (!(x->props.flags & XFRM_STATE_NOECN))
                        ipip_ecn_decapsulate(skb);
        }
index 28f36b363d1f00ca6df0c1f77dd1fc59fb19023e..9d3bd338e5d0b538d91dd4d40388eebe9c9fb218 100644 (file)
@@ -28,7 +28,7 @@ static inline void ipip6_ecn_decapsulate(struct sk_buff *skb)
 static inline void ip6ip_ecn_decapsulate(struct sk_buff *skb)
 {
        if (INET_ECN_is_ce(ipv6_get_dsfield(ipv6_hdr(skb))))
-                       IP_ECN_set_ce(skb->h.ipiph);
+                       IP_ECN_set_ce(ipip_hdr(skb));
 }
 
 /* Add encapsulation header.