From: Stephen Suryaputra Date: Tue, 25 Jun 2019 00:14:06 +0000 (-0400) Subject: ipv4: Use return value of inet_iif() for __raw_v4_lookup in the while loop X-Git-Tag: v5.1.16~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c79ab459bea42f66f5c4d161dc41f9d8e40ab4ff;p=thirdparty%2Fkernel%2Fstable.git ipv4: Use return value of inet_iif() for __raw_v4_lookup in the while loop [ Upstream commit 38c73529de13e1e10914de7030b659a2f8b01c3b ] In commit 19e4e768064a8 ("ipv4: Fix raw socket lookup for local traffic"), the dif argument to __raw_v4_lookup() is coming from the returned value of inet_iif() but the change was done only for the first lookup. Subsequent lookups in the while loop still use skb->dev->ifIndex. Fixes: 19e4e768064a8 ("ipv4: Fix raw socket lookup for local traffic") Signed-off-by: Stephen Suryaputra Reviewed-by: David Ahern Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c index dc91c27bb788c..3f6e95cb21b05 100644 --- a/net/ipv4/raw.c +++ b/net/ipv4/raw.c @@ -201,7 +201,7 @@ static int raw_v4_input(struct sk_buff *skb, const struct iphdr *iph, int hash) } sk = __raw_v4_lookup(net, sk_next(sk), iph->protocol, iph->saddr, iph->daddr, - skb->dev->ifindex, sdif); + dif, sdif); } out: read_unlock(&raw_v4_hashinfo.lock);