Commit 7eaa48a4 authored by David S. Miller's avatar David S. Miller

Revert "ipv6: fix checkpatch errors in net/ipv6/addrconf.c"

This reverts commit df8372ca.

These changes are buggy and make unintended semantic changes
to ip6_tnl_add_linklocal().
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f607e059
...@@ -2501,8 +2501,7 @@ static int inet6_addr_del(struct net *net, int ifindex, const struct in6_addr *p ...@@ -2501,8 +2501,7 @@ static int inet6_addr_del(struct net *net, int ifindex, const struct in6_addr *p
if (!dev) if (!dev)
return -ENODEV; return -ENODEV;
idev = __in6_dev_get(dev); if ((idev = __in6_dev_get(dev)) == NULL)
if (!idev)
return -ENXIO; return -ENXIO;
read_lock_bh(&idev->lock); read_lock_bh(&idev->lock);
...@@ -2641,8 +2640,7 @@ static void init_loopback(struct net_device *dev) ...@@ -2641,8 +2640,7 @@ static void init_loopback(struct net_device *dev)
ASSERT_RTNL(); ASSERT_RTNL();
idev = ipv6_find_idev(dev); if ((idev = ipv6_find_idev(dev)) == NULL) {
if (!idev) {
pr_debug("%s: add_dev failed\n", __func__); pr_debug("%s: add_dev failed\n", __func__);
return; return;
} }
...@@ -2740,8 +2738,7 @@ static void addrconf_sit_config(struct net_device *dev) ...@@ -2740,8 +2738,7 @@ static void addrconf_sit_config(struct net_device *dev)
* our v4 addrs in the tunnel * our v4 addrs in the tunnel
*/ */
idev = ipv6_find_idev(dev); if ((idev = ipv6_find_idev(dev)) == NULL) {
if (!idev) {
pr_debug("%s: add_dev failed\n", __func__); pr_debug("%s: add_dev failed\n", __func__);
return; return;
} }
...@@ -2773,8 +2770,7 @@ static void addrconf_gre_config(struct net_device *dev) ...@@ -2773,8 +2770,7 @@ static void addrconf_gre_config(struct net_device *dev)
ASSERT_RTNL(); ASSERT_RTNL();
idev = ipv6_find_idev(dev); if ((idev = ipv6_find_idev(dev)) == NULL) {
if (!idev) {
pr_debug("%s: add_dev failed\n", __func__); pr_debug("%s: add_dev failed\n", __func__);
return; return;
} }
...@@ -2805,11 +2801,11 @@ static void ip6_tnl_add_linklocal(struct inet6_dev *idev) ...@@ -2805,11 +2801,11 @@ static void ip6_tnl_add_linklocal(struct inet6_dev *idev)
struct net *net = dev_net(idev->dev); struct net *net = dev_net(idev->dev);
/* first try to inherit the link-local address from the link device */ /* first try to inherit the link-local address from the link device */
if (idev->dev->iflink) if (idev->dev->iflink &&
link_dev = __dev_get_by_index(net, idev->dev->iflink); (link_dev = __dev_get_by_index(net, idev->dev->iflink))) {
if (link_dev && !ipv6_inherit_linklocal(idev, link_dev)) if (!ipv6_inherit_linklocal(idev, link_dev))
return; return;
}
/* then try to inherit it from any device */ /* then try to inherit it from any device */
for_each_netdev(net, link_dev) { for_each_netdev(net, link_dev) {
if (!ipv6_inherit_linklocal(idev, link_dev)) if (!ipv6_inherit_linklocal(idev, link_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