aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/ipip.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2007-04-21 01:47:35 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 01:25:10 -0400
commiteddc9ec53be2ecdbf4efe0efd4a83052594f0ac0 (patch)
tree4a38ab4dbd9d61fdf5a5ea6ed61463e0b9e33ba7 /net/ipv4/ipip.c
parente023dd643798c4f06c16466af90b4d250e4b8bd7 (diff)
[SK_BUFF]: Introduce ip_hdr(), remove skb->nh.iph
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ipip.c')
-rw-r--r--net/ipv4/ipip.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c
index 843cc09f961f..b7f6ff4705b0 100644
--- a/net/ipv4/ipip.c
+++ b/net/ipv4/ipip.c
@@ -461,9 +461,10 @@ out:
461#endif 461#endif
462} 462}
463 463
464static inline void ipip_ecn_decapsulate(struct iphdr *outer_iph, struct sk_buff *skb) 464static inline void ipip_ecn_decapsulate(const struct iphdr *outer_iph,
465 struct sk_buff *skb)
465{ 466{
466 struct iphdr *inner_iph = skb->nh.iph; 467 struct iphdr *inner_iph = ip_hdr(skb);
467 468
468 if (INET_ECN_is_ce(outer_iph->tos)) 469 if (INET_ECN_is_ce(outer_iph->tos))
469 IP_ECN_set_ce(inner_iph); 470 IP_ECN_set_ce(inner_iph);
@@ -471,10 +472,8 @@ static inline void ipip_ecn_decapsulate(struct iphdr *outer_iph, struct sk_buff
471 472
472static int ipip_rcv(struct sk_buff *skb) 473static int ipip_rcv(struct sk_buff *skb)
473{ 474{
474 struct iphdr *iph;
475 struct ip_tunnel *tunnel; 475 struct ip_tunnel *tunnel;
476 476 const struct iphdr *iph = ip_hdr(skb);
477 iph = skb->nh.iph;
478 477
479 read_lock(&ipip_lock); 478 read_lock(&ipip_lock);
480 if ((tunnel = ipip_tunnel_lookup(iph->saddr, iph->daddr)) != NULL) { 479 if ((tunnel = ipip_tunnel_lookup(iph->saddr, iph->daddr)) != NULL) {
@@ -521,7 +520,7 @@ static int ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
521 __be16 df = tiph->frag_off; 520 __be16 df = tiph->frag_off;
522 struct rtable *rt; /* Route to the other host */ 521 struct rtable *rt; /* Route to the other host */
523 struct net_device *tdev; /* Device to other host */ 522 struct net_device *tdev; /* Device to other host */
524 struct iphdr *old_iph = skb->nh.iph; 523 struct iphdr *old_iph = ip_hdr(skb);
525 struct iphdr *iph; /* Our new IP header */ 524 struct iphdr *iph; /* Our new IP header */
526 int max_headroom; /* The extra header space needed */ 525 int max_headroom; /* The extra header space needed */
527 __be32 dst = tiph->daddr; 526 __be32 dst = tiph->daddr;
@@ -615,7 +614,7 @@ static int ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
615 skb_set_owner_w(new_skb, skb->sk); 614 skb_set_owner_w(new_skb, skb->sk);
616 dev_kfree_skb(skb); 615 dev_kfree_skb(skb);
617 skb = new_skb; 616 skb = new_skb;
618 old_iph = skb->nh.iph; 617 old_iph = ip_hdr(skb);
619 } 618 }
620 619
621 skb->h.raw = skb->nh.raw; 620 skb->h.raw = skb->nh.raw;
@@ -631,7 +630,7 @@ static int ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
631 * Push down and install the IPIP header. 630 * Push down and install the IPIP header.
632 */ 631 */
633 632
634 iph = skb->nh.iph; 633 iph = ip_hdr(skb);
635 iph->version = 4; 634 iph->version = 4;
636 iph->ihl = sizeof(struct iphdr)>>2; 635 iph->ihl = sizeof(struct iphdr)>>2;
637 iph->frag_off = df; 636 iph->frag_off = df;