aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorJohn Heffner <jheffner@psc.edu>2007-03-26 02:32:29 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 01:28:07 -0400
commit9af3912ec9e30509b76cb376abb65a4d8af27df3 (patch)
treed640cf87254d86ed6f0a862460d85029573763a5 /net/ipv4
parentb3da2cf37c5c6e47698957a25ab43a7223dbb90f (diff)
[NET] Move DF check to ip_forward
Do fragmentation check in ip_forward, similar to ipv6 forwarding. Signed-off-by: John Heffner <jheffner@psc.edu> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/ip_forward.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/net/ipv4/ip_forward.c b/net/ipv4/ip_forward.c
index 467ebedb99b..61b30d10067 100644
--- a/net/ipv4/ip_forward.c
+++ b/net/ipv4/ip_forward.c
@@ -85,6 +85,14 @@ 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;