aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/ip_sockglue.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/ip_sockglue.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/ip_sockglue.c')
-rw-r--r--net/ipv4/ip_sockglue.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c
index 70888e1ef6b7..fabc250e16dd 100644
--- a/net/ipv4/ip_sockglue.c
+++ b/net/ipv4/ip_sockglue.c
@@ -59,7 +59,7 @@ static void ip_cmsg_recv_pktinfo(struct msghdr *msg, struct sk_buff *skb)
59 struct in_pktinfo info; 59 struct in_pktinfo info;
60 struct rtable *rt = (struct rtable *)skb->dst; 60 struct rtable *rt = (struct rtable *)skb->dst;
61 61
62 info.ipi_addr.s_addr = skb->nh.iph->daddr; 62 info.ipi_addr.s_addr = ip_hdr(skb)->daddr;
63 if (rt) { 63 if (rt) {
64 info.ipi_ifindex = rt->rt_iif; 64 info.ipi_ifindex = rt->rt_iif;
65 info.ipi_spec_dst.s_addr = rt->rt_spec_dst; 65 info.ipi_spec_dst.s_addr = rt->rt_spec_dst;
@@ -73,13 +73,13 @@ static void ip_cmsg_recv_pktinfo(struct msghdr *msg, struct sk_buff *skb)
73 73
74static void ip_cmsg_recv_ttl(struct msghdr *msg, struct sk_buff *skb) 74static void ip_cmsg_recv_ttl(struct msghdr *msg, struct sk_buff *skb)
75{ 75{
76 int ttl = skb->nh.iph->ttl; 76 int ttl = ip_hdr(skb)->ttl;
77 put_cmsg(msg, SOL_IP, IP_TTL, sizeof(int), &ttl); 77 put_cmsg(msg, SOL_IP, IP_TTL, sizeof(int), &ttl);
78} 78}
79 79
80static void ip_cmsg_recv_tos(struct msghdr *msg, struct sk_buff *skb) 80static void ip_cmsg_recv_tos(struct msghdr *msg, struct sk_buff *skb)
81{ 81{
82 put_cmsg(msg, SOL_IP, IP_TOS, 1, &skb->nh.iph->tos); 82 put_cmsg(msg, SOL_IP, IP_TOS, 1, &ip_hdr(skb)->tos);
83} 83}
84 84
85static void ip_cmsg_recv_opts(struct msghdr *msg, struct sk_buff *skb) 85static void ip_cmsg_recv_opts(struct msghdr *msg, struct sk_buff *skb)
@@ -87,7 +87,8 @@ static void ip_cmsg_recv_opts(struct msghdr *msg, struct sk_buff *skb)
87 if (IPCB(skb)->opt.optlen == 0) 87 if (IPCB(skb)->opt.optlen == 0)
88 return; 88 return;
89 89
90 put_cmsg(msg, SOL_IP, IP_RECVOPTS, IPCB(skb)->opt.optlen, skb->nh.iph+1); 90 put_cmsg(msg, SOL_IP, IP_RECVOPTS, IPCB(skb)->opt.optlen,
91 ip_hdr(skb) + 1);
91} 92}
92 93
93 94
@@ -299,7 +300,7 @@ void ip_local_error(struct sock *sk, int err, __be32 daddr, __be16 port, u32 inf
299 300
300 skb_put(skb, sizeof(struct iphdr)); 301 skb_put(skb, sizeof(struct iphdr));
301 skb_reset_network_header(skb); 302 skb_reset_network_header(skb);
302 iph = skb->nh.iph; 303 iph = ip_hdr(skb);
303 iph->daddr = daddr; 304 iph->daddr = daddr;
304 305
305 serr = SKB_EXT_ERR(skb); 306 serr = SKB_EXT_ERR(skb);
@@ -369,7 +370,7 @@ int ip_recv_error(struct sock *sk, struct msghdr *msg, int len)
369 struct inet_sock *inet = inet_sk(sk); 370 struct inet_sock *inet = inet_sk(sk);
370 371
371 sin->sin_family = AF_INET; 372 sin->sin_family = AF_INET;
372 sin->sin_addr.s_addr = skb->nh.iph->saddr; 373 sin->sin_addr.s_addr = ip_hdr(skb)->saddr;
373 sin->sin_port = 0; 374 sin->sin_port = 0;
374 memset(&sin->sin_zero, 0, sizeof(sin->sin_zero)); 375 memset(&sin->sin_zero, 0, sizeof(sin->sin_zero));
375 if (inet->cmsg_flags) 376 if (inet->cmsg_flags)