diff options
author | Paolo Abeni <pabeni@redhat.com> | 2016-04-21 22:23:31 +0200 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2017-10-12 15:28:12 +0100 |
commit | 0bdce0a368321adb9fcd2d7255cd5f3e71140212 (patch) | |
tree | cefe52c1f5128c95cabc3f57e2e34a050b10e75a | |
parent | 246e7965d0e9043d7d265a000a8dba6ad7148ccd (diff) | |
download | linux-stable-0bdce0a368321adb9fcd2d7255cd5f3e71140212.tar.gz linux-stable-0bdce0a368321adb9fcd2d7255cd5f3e71140212.tar.bz2 linux-stable-0bdce0a368321adb9fcd2d7255cd5f3e71140212.zip |
ipv4/fib: don't warn when primary address is missing if in_dev is dead
[ Upstream commit 391a20333b8393ef2e13014e6e59d192c5594471 ]
After commit fbd40ea0180a ("ipv4: Don't do expensive useless work
during inetdev destroy.") when deleting an interface,
fib_del_ifaddr() can be executed without any primary address
present on the dead interface.
The above is safe, but triggers some "bug: prim == NULL" warnings.
This commit avoids warning if the in_dev is dead
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
[bwh: Backported to 3.16: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-rw-r--r-- | net/ipv4/fib_frontend.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c index 7d736cd3ee91..c232ededeaa2 100644 --- a/net/ipv4/fib_frontend.c +++ b/net/ipv4/fib_frontend.c @@ -797,7 +797,11 @@ void fib_del_ifaddr(struct in_ifaddr *ifa, struct in_ifaddr *iprim) if (ifa->ifa_flags & IFA_F_SECONDARY) { prim = inet_ifa_byprefix(in_dev, any, ifa->ifa_mask); if (prim == NULL) { - pr_warn("%s: bug: prim == NULL\n", __func__); + /* if the device has been deleted, we don't perform + * address promotion + */ + if (!in_dev->dead) + pr_warn("%s: bug: prim == NULL\n", __func__); return; } if (iprim && iprim != prim) { |