Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 090f1166 authored by Li RongQing's avatar Li RongQing Committed by David S. Miller
Browse files

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: default avatarLi RongQing <roy.qing.li@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fcb308d5
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -367,6 +367,9 @@ int ip6_forward(struct sk_buff *skb)
	if (net->ipv6.devconf_all->forwarding == 0)
	if (net->ipv6.devconf_all->forwarding == 0)
		goto error;
		goto error;


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

	if (skb_warn_if_lro(skb))
	if (skb_warn_if_lro(skb))
		goto drop;
		goto drop;


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


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

	skb_forward_csum(skb);
	skb_forward_csum(skb);


	/*
	/*