Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=39b89160df691045d1449cbaef43c02084c7543a
Commit:     39b89160df691045d1449cbaef43c02084c7543a
Parent:     b0061ce49c83657563b64ffcf1ec137110230d93
Author:     Arnaldo Carvalho de Melo <[EMAIL PROTECTED]>
AuthorDate: Tue Apr 10 21:06:25 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Apr 25 22:25:28 2007 -0700

    [SK_BUFF]: Introduce ipipv6_hdr(), remove skb->h.ipv6h
    
    Signed-off-by: Arnaldo Carvalho de Melo <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 include/linux/ipv6.h         |    5 +++++
 include/linux/skbuff.h       |    1 -
 net/ipv6/xfrm6_mode_beet.c   |    4 ++--
 net/ipv6/xfrm6_mode_tunnel.c |    8 ++++----
 4 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index ec79c59..b768fcc 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -228,6 +228,11 @@ 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->h.raw;
+}
+
 /* 
    This structure contains results of exthdrs parsing
    as offsets from skb->nh.
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 862a81c..d3f1862 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -237,7 +237,6 @@ struct sk_buff {
        /* 4 byte hole on 64 bit*/
 
        union {
-               struct ipv6hdr  *ipv6h;
                unsigned char   *raw;
        } h;
 
diff --git a/net/ipv6/xfrm6_mode_beet.c b/net/ipv6/xfrm6_mode_beet.c
index abac094..0cc96ec 100644
--- a/net/ipv6/xfrm6_mode_beet.c
+++ b/net/ipv6/xfrm6_mode_beet.c
@@ -47,8 +47,8 @@ static int xfrm6_beet_output(struct xfrm_state *x, struct 
sk_buff *skb)
 
        skb_reset_network_header(skb);
        top_iph = ipv6_hdr(skb);
-       skb->nh.raw = &top_iph->nexthdr;
-       skb->h.ipv6h = top_iph + 1;
+       skb->h.raw = skb->nh.raw + sizeof(struct ipv6hdr);
+       skb->nh.raw += offsetof(struct ipv6hdr, nexthdr);
 
        ipv6_addr_copy(&top_iph->saddr, (struct in6_addr *)&x->props.saddr);
        ipv6_addr_copy(&top_iph->daddr, (struct in6_addr *)&x->id.daddr);
diff --git a/net/ipv6/xfrm6_mode_tunnel.c b/net/ipv6/xfrm6_mode_tunnel.c
index 9d3bd33..21d65df 100644
--- a/net/ipv6/xfrm6_mode_tunnel.c
+++ b/net/ipv6/xfrm6_mode_tunnel.c
@@ -19,7 +19,7 @@
 static inline void ipip6_ecn_decapsulate(struct sk_buff *skb)
 {
        struct ipv6hdr *outer_iph = ipv6_hdr(skb);
-       struct ipv6hdr *inner_iph = skb->h.ipv6h;
+       struct ipv6hdr *inner_iph = ipipv6_hdr(skb);
 
        if (INET_ECN_is_ce(ipv6_get_dsfield(outer_iph)))
                IP6_ECN_set_ce(inner_iph);
@@ -55,8 +55,8 @@ static int xfrm6_tunnel_output(struct xfrm_state *x, struct 
sk_buff *skb)
 
        skb_reset_network_header(skb);
        top_iph = ipv6_hdr(skb);
-       skb->nh.raw = &top_iph->nexthdr;
-       skb->h.ipv6h = top_iph + 1;
+       skb->h.raw = skb->nh.raw + sizeof(struct ipv6hdr);
+       skb->nh.raw += offsetof(struct ipv6hdr, nexthdr);
 
        top_iph->version = 6;
        if (xdst->route->ops->family == AF_INET6) {
@@ -102,7 +102,7 @@ static int xfrm6_tunnel_input(struct xfrm_state *x, struct 
sk_buff *skb)
        nh = skb_network_header(skb);
        if (nh[IP6CB(skb)->nhoff] == IPPROTO_IPV6) {
                if (x->props.flags & XFRM_STATE_DECAP_DSCP)
-                       ipv6_copy_dscp(ipv6_hdr(skb), skb->h.ipv6h);
+                       ipv6_copy_dscp(ipv6_hdr(skb), ipipv6_hdr(skb));
                if (!(x->props.flags & XFRM_STATE_NOECN))
                        ipip6_ecn_decapsulate(skb);
        } else {
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to