diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-04-27 12:26:46 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-04-27 12:26:46 -0400 |
commit | 15c54033964a943de7b0763efd3bd0ede7326395 (patch) | |
tree | 840b292612d1b5396d5bab5bde537a9013db3ceb /net/ipv4/raw.c | |
parent | ad5da3cf39a5b11a198929be1f2644e17ecd767e (diff) | |
parent | 912a41a4ab935ce8c4308428ec13fc7f8b1f18f4 (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6: (448 commits)
[IPV4] nl_fib_lookup: Initialise res.r before fib_res_put(&res)
[IPV6]: Fix thinko in ipv6_rthdr_rcv() changes.
[IPV4]: Add multipath cached to feature-removal-schedule.txt
[WIRELESS] cfg80211: Clarify locking comment.
[WIRELESS] cfg80211: Fix locking in wiphy_new.
[WEXT] net_device: Don't include wext bits if not required.
[WEXT]: Misc code cleanups.
[WEXT]: Reduce inline abuse.
[WEXT]: Move EXPORT_SYMBOL statements where they belong.
[WEXT]: Cleanup early ioctl call path.
[WEXT]: Remove options.
[WEXT]: Remove dead debug code.
[WEXT]: Clean up how wext is called.
[WEXT]: Move to net/wireless
[AFS]: Eliminate cmpxchg() usage in vlocation code.
[RXRPC]: Fix pointers passed to bitops.
[RXRPC]: Remove bogus atomic_* overrides.
[AFS]: Fix u64 printing in debug logging.
[AFS]: Add "directory write" support.
[AFS]: Implement the CB.InitCallBackState3 operation.
...
Diffstat (limited to 'net/ipv4/raw.c')
-rw-r--r-- | net/ipv4/raw.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c index 87e9c1618100..24d7c9f31918 100644 --- a/net/ipv4/raw.c +++ b/net/ipv4/raw.c | |||
@@ -132,7 +132,7 @@ static __inline__ int icmp_filter(struct sock *sk, struct sk_buff *skb) | |||
132 | if (!pskb_may_pull(skb, sizeof(struct icmphdr))) | 132 | if (!pskb_may_pull(skb, sizeof(struct icmphdr))) |
133 | return 1; | 133 | return 1; |
134 | 134 | ||
135 | type = skb->h.icmph->type; | 135 | type = icmp_hdr(skb)->type; |
136 | if (type < 32) { | 136 | if (type < 32) { |
137 | __u32 data = raw_sk(sk)->filter.data; | 137 | __u32 data = raw_sk(sk)->filter.data; |
138 | 138 | ||
@@ -184,8 +184,8 @@ out: | |||
184 | void raw_err (struct sock *sk, struct sk_buff *skb, u32 info) | 184 | void raw_err (struct sock *sk, struct sk_buff *skb, u32 info) |
185 | { | 185 | { |
186 | struct inet_sock *inet = inet_sk(sk); | 186 | struct inet_sock *inet = inet_sk(sk); |
187 | int type = skb->h.icmph->type; | 187 | const int type = icmp_hdr(skb)->type; |
188 | int code = skb->h.icmph->code; | 188 | const int code = icmp_hdr(skb)->code; |
189 | int err = 0; | 189 | int err = 0; |
190 | int harderr = 0; | 190 | int harderr = 0; |
191 | 191 | ||
@@ -256,7 +256,7 @@ int raw_rcv(struct sock *sk, struct sk_buff *skb) | |||
256 | } | 256 | } |
257 | nf_reset(skb); | 257 | nf_reset(skb); |
258 | 258 | ||
259 | skb_push(skb, skb->data - skb->nh.raw); | 259 | skb_push(skb, skb->data - skb_network_header(skb)); |
260 | 260 | ||
261 | raw_rcv_skb(sk, skb); | 261 | raw_rcv_skb(sk, skb); |
262 | return 0; | 262 | return 0; |
@@ -291,11 +291,13 @@ static int raw_send_hdrinc(struct sock *sk, void *from, size_t length, | |||
291 | skb->priority = sk->sk_priority; | 291 | skb->priority = sk->sk_priority; |
292 | skb->dst = dst_clone(&rt->u.dst); | 292 | skb->dst = dst_clone(&rt->u.dst); |
293 | 293 | ||
294 | skb->nh.iph = iph = (struct iphdr *)skb_put(skb, length); | 294 | skb_reset_network_header(skb); |
295 | iph = ip_hdr(skb); | ||
296 | skb_put(skb, length); | ||
295 | 297 | ||
296 | skb->ip_summed = CHECKSUM_NONE; | 298 | skb->ip_summed = CHECKSUM_NONE; |
297 | 299 | ||
298 | skb->h.raw = skb->nh.raw; | 300 | skb->transport_header = skb->network_header; |
299 | err = memcpy_fromiovecend((void *)iph, from, 0, length); | 301 | err = memcpy_fromiovecend((void *)iph, from, 0, length); |
300 | if (err) | 302 | if (err) |
301 | goto error_fault; | 303 | goto error_fault; |
@@ -613,7 +615,7 @@ static int raw_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
613 | /* Copy the address. */ | 615 | /* Copy the address. */ |
614 | if (sin) { | 616 | if (sin) { |
615 | sin->sin_family = AF_INET; | 617 | sin->sin_family = AF_INET; |
616 | sin->sin_addr.s_addr = skb->nh.iph->saddr; | 618 | sin->sin_addr.s_addr = ip_hdr(skb)->saddr; |
617 | sin->sin_port = 0; | 619 | sin->sin_port = 0; |
618 | memset(&sin->sin_zero, 0, sizeof(sin->sin_zero)); | 620 | memset(&sin->sin_zero, 0, sizeof(sin->sin_zero)); |
619 | } | 621 | } |
@@ -887,7 +889,7 @@ static int raw_seq_show(struct seq_file *seq, void *v) | |||
887 | return 0; | 889 | return 0; |
888 | } | 890 | } |
889 | 891 | ||
890 | static struct seq_operations raw_seq_ops = { | 892 | static const struct seq_operations raw_seq_ops = { |
891 | .start = raw_seq_start, | 893 | .start = raw_seq_start, |
892 | .next = raw_seq_next, | 894 | .next = raw_seq_next, |
893 | .stop = raw_seq_stop, | 895 | .stop = raw_seq_stop, |