]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
ipv4: Use return value of inet_iif() for __raw_v4_lookup in the while loop
authorStephen Suryaputra <ssuryaextr@gmail.com>
Tue, 25 Jun 2019 00:14:06 +0000 (20:14 -0400)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
BugLink: https://bugs.launchpad.net/bugs/1838824
[ 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 <ssuryaextr@gmail.com>
Reviewed-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
net/ipv4/raw.c

index a60e955d31e899b7e98bc329f520cbb3f2b93aa5..261a9813b88cd1171d0017b0b9bd96637df289a7 100644 (file)
@@ -202,7 +202,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);