diff --git a/net/core/dst.c b/net/core/dst.c index b5cbbe0..99184ba 100644 --- a/net/core/dst.c +++ b/net/core/dst.c @@ -441,8 +441,12 @@ static void dst_ifdown(struct dst_entry *dst, struct net_device *dev, dst->input = dst_discard; dst->output = dst_discard_out; } else { - dst->dev = dev_net(dst->dev)->loopback_dev; - dev_hold(dst->dev); + if (dst->dev != dev_net(dst->dev)->loopback_dev) { + dst->dev = dev_net(dst->dev)->loopback_dev; + dev_hold(dst->dev); + } else { + dst->dev = NULL; + } dev_put(dev); } }