Skip to content

Commit

Permalink
ipv6: ip6_forward: perform skb->pkt_type check at the beginning
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Li RongQing authored and David S. Miller committed Mar 11, 2014
1 parent fcb308d commit 090f116
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions net/ipv6/ip6_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,9 @@ int ip6_forward(struct sk_buff *skb)
if (net->ipv6.devconf_all->forwarding == 0)
goto error;

if (skb->pkt_type != PACKET_HOST)
goto drop;

if (skb_warn_if_lro(skb))
goto drop;

Expand All @@ -376,9 +379,6 @@ int ip6_forward(struct sk_buff *skb)
goto drop;
}

if (skb->pkt_type != PACKET_HOST)
goto drop;

skb_forward_csum(skb);

/*
Expand Down

0 comments on commit 090f116

Please sign in to comment.