aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6
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/ipv6
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/ipv6')
-rw-r--r--net/ipv6/datagram.c3
-rw-r--r--net/ipv6/ip6_tunnel.c8
-rw-r--r--net/ipv6/sit.c4
-rw-r--r--net/ipv6/udp.c2
4 files changed, 8 insertions, 9 deletions
diff --git a/net/ipv6/datagram.c b/net/ipv6/datagram.c
index 7a86db6163ee..ac95d3bfdfb7 100644
--- a/net/ipv6/datagram.c
+++ b/net/ipv6/datagram.c
@@ -349,8 +349,7 @@ int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len)
349 struct inet_sock *inet = inet_sk(sk); 349 struct inet_sock *inet = inet_sk(sk);
350 350
351 ipv6_addr_set(&sin->sin6_addr, 0, 0, 351 ipv6_addr_set(&sin->sin6_addr, 0, 0,
352 htonl(0xffff), 352 htonl(0xffff), ip_hdr(skb)->saddr);
353 skb->nh.iph->saddr);
354 if (inet->cmsg_flags) 353 if (inet->cmsg_flags)
355 ip_cmsg_recv(msg, skb); 354 ip_cmsg_recv(msg, skb);
356 } 355 }
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
index aafbdfa8d785..bb65779be7a6 100644
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -526,7 +526,7 @@ ip4ip6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
526 skb2->dst = NULL; 526 skb2->dst = NULL;
527 skb_pull(skb2, offset); 527 skb_pull(skb2, offset);
528 skb_reset_network_header(skb2); 528 skb_reset_network_header(skb2);
529 eiph = skb2->nh.iph; 529 eiph = ip_hdr(skb2);
530 530
531 /* Try to guess incoming interface */ 531 /* Try to guess incoming interface */
532 memset(&fl, 0, sizeof(fl)); 532 memset(&fl, 0, sizeof(fl));
@@ -625,10 +625,10 @@ static void ip4ip6_dscp_ecn_decapsulate(struct ip6_tnl *t,
625 __u8 dsfield = ipv6_get_dsfield(ipv6h) & ~INET_ECN_MASK; 625 __u8 dsfield = ipv6_get_dsfield(ipv6h) & ~INET_ECN_MASK;
626 626
627 if (t->parms.flags & IP6_TNL_F_RCV_DSCP_COPY) 627 if (t->parms.flags & IP6_TNL_F_RCV_DSCP_COPY)
628 ipv4_change_dsfield(skb->nh.iph, INET_ECN_MASK, dsfield); 628 ipv4_change_dsfield(ip_hdr(skb), INET_ECN_MASK, dsfield);
629 629
630 if (INET_ECN_is_ce(dsfield)) 630 if (INET_ECN_is_ce(dsfield))
631 IP_ECN_set_ce(skb->nh.iph); 631 IP_ECN_set_ce(ip_hdr(skb));
632} 632}
633 633
634static void ip6ip6_dscp_ecn_decapsulate(struct ip6_tnl *t, 634static void ip6ip6_dscp_ecn_decapsulate(struct ip6_tnl *t,
@@ -944,7 +944,7 @@ static inline int
944ip4ip6_tnl_xmit(struct sk_buff *skb, struct net_device *dev) 944ip4ip6_tnl_xmit(struct sk_buff *skb, struct net_device *dev)
945{ 945{
946 struct ip6_tnl *t = netdev_priv(dev); 946 struct ip6_tnl *t = netdev_priv(dev);
947 struct iphdr *iph = skb->nh.iph; 947 struct iphdr *iph = ip_hdr(skb);
948 int encap_limit = -1; 948 int encap_limit = -1;
949 struct flowi fl; 949 struct flowi fl;
950 __u8 dsfield; 950 __u8 dsfield;
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index 62883d41b6c3..e33ac3c3a9ca 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -377,7 +377,7 @@ static int ipip6_rcv(struct sk_buff *skb)
377 if (!pskb_may_pull(skb, sizeof(struct ipv6hdr))) 377 if (!pskb_may_pull(skb, sizeof(struct ipv6hdr)))
378 goto out; 378 goto out;
379 379
380 iph = skb->nh.iph; 380 iph = ip_hdr(skb);
381 381
382 read_lock(&ipip6_lock); 382 read_lock(&ipip6_lock);
383 if ((tunnel = ipip6_tunnel_lookup(iph->saddr, iph->daddr)) != NULL) { 383 if ((tunnel = ipip6_tunnel_lookup(iph->saddr, iph->daddr)) != NULL) {
@@ -565,7 +565,7 @@ static int ipip6_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
565 * Push down and install the IPIP header. 565 * Push down and install the IPIP header.
566 */ 566 */
567 567
568 iph = skb->nh.iph; 568 iph = ip_hdr(skb);
569 iph->version = 4; 569 iph->version = 4;
570 iph->ihl = sizeof(struct iphdr)>>2; 570 iph->ihl = sizeof(struct iphdr)>>2;
571 if (mtu > IPV6_MIN_MTU) 571 if (mtu > IPV6_MIN_MTU)
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index 87b06a80102b..e991e606ab1f 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -178,7 +178,7 @@ try_again:
178 178
179 if (skb->protocol == htons(ETH_P_IP)) 179 if (skb->protocol == htons(ETH_P_IP))
180 ipv6_addr_set(&sin6->sin6_addr, 0, 0, 180 ipv6_addr_set(&sin6->sin6_addr, 0, 0,
181 htonl(0xffff), skb->nh.iph->saddr); 181 htonl(0xffff), ip_hdr(skb)->saddr);
182 else { 182 else {
183 ipv6_addr_copy(&sin6->sin6_addr, &skb->nh.ipv6h->saddr); 183 ipv6_addr_copy(&sin6->sin6_addr, &skb->nh.ipv6h->saddr);
184 if (ipv6_addr_type(&sin6->sin6_addr) & IPV6_ADDR_LINKLOCAL) 184 if (ipv6_addr_type(&sin6->sin6_addr) & IPV6_ADDR_LINKLOCAL)