Commit d7e95acd authored by Hideaki Yoshifuji's avatar Hideaki Yoshifuji

[IPV6]: Fix device handling in ip6_route_add().

Signed-off-by: default avatarHIDEAKI Yoshifuji <yoshfuji@linux-ipv6.org>
Signed-off-by: default avatarDavid S. Miller <davem@redhat.com>
parent 5a528e75
......@@ -820,9 +820,12 @@ int ip6_route_add(struct in6_rtmsg *rtmsg, struct nlmsghdr *nlh, void *_rtattr)
*/
if ((rtmsg->rtmsg_flags&RTF_REJECT) ||
(dev && (dev->flags&IFF_LOOPBACK) && !(addr_type&IPV6_ADDR_LOOPBACK))) {
if (dev && dev != &loopback_dev) {
dev_put(dev);
in6_dev_put(idev);
/* hold loopback dev/idev if we haven't done so. */
if (dev != &loopback_dev) {
if (dev) {
dev_put(dev);
in6_dev_put(idev);
}
dev = &loopback_dev;
dev_hold(dev);
idev = in6_dev_get(dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment