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>
Wed, 18 Mar 2020 06:14:12 +0000 (07:14 +0100)
commiteb273bb8205c7eeed8da0bca7842fa68fd62d0bb
treebf767f631621b44fb922f4fda23ca56841b3e444
parentcb9e7197bbebbdfd762c34f64b1e55d8b526c345
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