diff options
author | Li RongQing <roy.qing.li@gmail.com> | 2014-03-10 22:40:08 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-03-11 00:37:42 -0400 |
commit | 090f1166c6790e18c30f40690098829709e8dc68 (patch) | |
tree | e3a11c9d9e8ff209ba6f46f65f831bc7f696d999 /net/ipv6/ip6_output.c | |
parent | fcb308d52991cbdb6231ab0e7ec3e5d1c61b3a20 (diff) |
ipv6: ip6_forward: perform skb->pkt_type check at the beginning
Packets which have L2 address different from ours should be
already filtered before entering into ip6_forward().
Perform that check at the beginning to avoid processing such packets.
Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/ip6_output.c')
-rw-r--r-- | net/ipv6/ip6_output.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index 2bc10701182b..90dd551fdd3c 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c | |||
@@ -367,6 +367,9 @@ int ip6_forward(struct sk_buff *skb) | |||
367 | if (net->ipv6.devconf_all->forwarding == 0) | 367 | if (net->ipv6.devconf_all->forwarding == 0) |
368 | goto error; | 368 | goto error; |
369 | 369 | ||
370 | if (skb->pkt_type != PACKET_HOST) | ||
371 | goto drop; | ||
372 | |||
370 | if (skb_warn_if_lro(skb)) | 373 | if (skb_warn_if_lro(skb)) |
371 | goto drop; | 374 | goto drop; |
372 | 375 | ||
@@ -376,9 +379,6 @@ int ip6_forward(struct sk_buff *skb) | |||
376 | goto drop; | 379 | goto drop; |
377 | } | 380 | } |
378 | 381 | ||
379 | if (skb->pkt_type != PACKET_HOST) | ||
380 | goto drop; | ||
381 | |||
382 | skb_forward_csum(skb); | 382 | skb_forward_csum(skb); |
383 | 383 | ||
384 | /* | 384 | /* |