net/{ipv4,ipv6}: Do not put target net if input nsid is invalid
authorBjørn Mork <bjorn@mork.no>
Thu, 25 Oct 2018 19:18:25 +0000 (21:18 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 25 Oct 2018 23:21:31 +0000 (16:21 -0700)
commitbf4cc40e9343bbe6c7400ff6f4feb46fb9338087
tree198ed7a7e5ab8259cd691f5ace526e17edbd9535
parent863d4187d05aafd53f13fe1f358e9eb42bb0dbc1
net/{ipv4,ipv6}: Do not put target net if input nsid is invalid

The cleanup path will put the target net when netnsid is set.  So we must
reset netnsid if the input is invalid.

Fixes: d7e38611b81e ("net/ipv4: Put target net when address dump fails due to bad attributes")
Fixes: 242afaa6968c ("net/ipv6: Put target net when address dump fails due to bad attributes")
Cc: David Ahern <dsahern@gmail.com>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Reviewed-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/devinet.c
net/ipv6/addrconf.c