ipvlan: don't deref eth hdr before checking it's set
authorMahesh Bandewar <maheshb@google.com>
Mon, 9 Mar 2020 22:56:56 +0000 (15:56 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 20 Mar 2020 08:07:42 +0000 (09:07 +0100)
commit2ad8246c4dbe850ee1acdb9cec162281f49ecec3
tree3ceec9faed8afacea3012d0fbc560d9e3e1142f4
parent8621153cb6c8b712cfad03c0fbbbf408c1ebc6e0
ipvlan: don't deref eth hdr before checking it's set

[ Upstream commit ad8192767c9f9cf97da57b9ffcea70fb100febef ]

IPvlan in L3 mode discards outbound multicast packets but performs
the check before ensuring the ether-header is set or not. This is
an error that Eric found through code browsing.

Fixes: 2ad7bf363841 (“ipvlan: Initial check-in of the IPVLAN driver.”)
Signed-off-by: Mahesh Bandewar <maheshb@google.com>
Reported-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ipvlan/ipvlan_core.c