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>
This commit is contained in:
Li RongQing 2014-03-11 10:40:08 +08:00 коммит произвёл David S. Miller
Родитель fcb308d529
Коммит 090f1166c6
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -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;
@ -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);
/*