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/ip_forward.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/ip_forward.c')
-rw-r--r-- | net/ipv4/ip_forward.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/net/ipv4/ip_forward.c b/net/ipv4/ip_forward.c index 369e721c4bab..9cb04df0054b 100644 --- a/net/ipv4/ip_forward.c +++ b/net/ipv4/ip_forward.c | |||
@@ -67,14 +67,14 @@ int ip_forward(struct sk_buff *skb) | |||
67 | if (skb->pkt_type != PACKET_HOST) | 67 | if (skb->pkt_type != PACKET_HOST) |
68 | goto drop; | 68 | goto drop; |
69 | 69 | ||
70 | skb->ip_summed = CHECKSUM_NONE; | 70 | skb_forward_csum(skb); |
71 | 71 | ||
72 | /* | 72 | /* |
73 | * According to the RFC, we must first decrease the TTL field. If | 73 | * According to the RFC, we must first decrease the TTL field. If |
74 | * that reaches zero, we must reply an ICMP control message telling | 74 | * that reaches zero, we must reply an ICMP control message telling |
75 | * that the packet's lifetime expired. | 75 | * that the packet's lifetime expired. |
76 | */ | 76 | */ |
77 | if (skb->nh.iph->ttl <= 1) | 77 | if (ip_hdr(skb)->ttl <= 1) |
78 | goto too_many_hops; | 78 | goto too_many_hops; |
79 | 79 | ||
80 | if (!xfrm4_route_forward(skb)) | 80 | if (!xfrm4_route_forward(skb)) |
@@ -85,10 +85,18 @@ int ip_forward(struct sk_buff *skb) | |||
85 | if (opt->is_strictroute && rt->rt_dst != rt->rt_gateway) | 85 | if (opt->is_strictroute && rt->rt_dst != rt->rt_gateway) |
86 | goto sr_failed; | 86 | goto sr_failed; |
87 | 87 | ||
88 | if (unlikely(skb->len > dst_mtu(&rt->u.dst) && | ||
89 | (ip_hdr(skb)->frag_off & htons(IP_DF))) && !skb->local_df) { | ||
90 | IP_INC_STATS(IPSTATS_MIB_FRAGFAILS); | ||
91 | icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED, | ||
92 | htonl(dst_mtu(&rt->u.dst))); | ||
93 | goto drop; | ||
94 | } | ||
95 | |||
88 | /* We are about to mangle packet. Copy it! */ | 96 | /* We are about to mangle packet. Copy it! */ |
89 | if (skb_cow(skb, LL_RESERVED_SPACE(rt->u.dst.dev)+rt->u.dst.header_len)) | 97 | if (skb_cow(skb, LL_RESERVED_SPACE(rt->u.dst.dev)+rt->u.dst.header_len)) |
90 | goto drop; | 98 | goto drop; |
91 | iph = skb->nh.iph; | 99 | iph = ip_hdr(skb); |
92 | 100 | ||
93 | /* Decrease ttl after skb cow done */ | 101 | /* Decrease ttl after skb cow done */ |
94 | ip_decrease_ttl(iph); | 102 | ip_decrease_ttl(iph); |