Skip to content

Commit ae79dbf

Browse files
ffourcotdavem330
authored andcommitted
ipv6/addrconf: use a boolean to choose between UNREGISTER/DOWN
"how" was used as a boolean. Change the type to bool, and improve variable name Signed-off-by: Florent Fourcot <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent d208a42 commit ae79dbf

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

net/ipv6/addrconf.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ static void addrconf_leave_anycast(struct inet6_ifaddr *ifp);
163163

164164
static void addrconf_type_change(struct net_device *dev,
165165
unsigned long event);
166-
static int addrconf_ifdown(struct net_device *dev, int how);
166+
static int addrconf_ifdown(struct net_device *dev, bool unregister);
167167

168168
static struct fib6_info *addrconf_get_prefix_route(const struct in6_addr *pfx,
169169
int plen,
@@ -3630,7 +3630,7 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event,
36303630
* an L3 master device (e.g., VRF)
36313631
*/
36323632
if (info->upper_dev && netif_is_l3_master(info->upper_dev))
3633-
addrconf_ifdown(dev, 0);
3633+
addrconf_ifdown(dev, false);
36343634
}
36353635

36363636
return NOTIFY_OK;
@@ -3663,9 +3663,9 @@ static bool addr_is_local(const struct in6_addr *addr)
36633663
(IPV6_ADDR_LINKLOCAL | IPV6_ADDR_LOOPBACK);
36643664
}
36653665

3666-
static int addrconf_ifdown(struct net_device *dev, int how)
3666+
static int addrconf_ifdown(struct net_device *dev, bool unregister)
36673667
{
3668-
unsigned long event = how ? NETDEV_UNREGISTER : NETDEV_DOWN;
3668+
unsigned long event = unregister ? NETDEV_UNREGISTER : NETDEV_DOWN;
36693669
struct net *net = dev_net(dev);
36703670
struct inet6_dev *idev;
36713671
struct inet6_ifaddr *ifa, *tmp;
@@ -3684,7 +3684,7 @@ static int addrconf_ifdown(struct net_device *dev, int how)
36843684
* Step 1: remove reference to ipv6 device from parent device.
36853685
* Do not dev_put!
36863686
*/
3687-
if (how) {
3687+
if (unregister) {
36883688
idev->dead = 1;
36893689

36903690
/* protected by rtnl_lock */
@@ -3698,7 +3698,7 @@ static int addrconf_ifdown(struct net_device *dev, int how)
36983698
/* combine the user config with event to determine if permanent
36993699
* addresses are to be removed from address hash table
37003700
*/
3701-
if (!how && !idev->cnf.disable_ipv6) {
3701+
if (!unregister && !idev->cnf.disable_ipv6) {
37023702
/* aggregate the system setting and interface setting */
37033703
int _keep_addr = net->ipv6.devconf_all->keep_addr_on_down;
37043704

@@ -3736,7 +3736,7 @@ static int addrconf_ifdown(struct net_device *dev, int how)
37363736
addrconf_del_rs_timer(idev);
37373737

37383738
/* Step 2: clear flags for stateless addrconf */
3739-
if (!how)
3739+
if (!unregister)
37403740
idev->if_flags &= ~(IF_RS_SENT|IF_RA_RCVD|IF_READY);
37413741

37423742
/* Step 3: clear tempaddr list */
@@ -3806,7 +3806,7 @@ static int addrconf_ifdown(struct net_device *dev, int how)
38063806
write_unlock_bh(&idev->lock);
38073807

38083808
/* Step 5: Discard anycast and multicast list */
3809-
if (how) {
3809+
if (unregister) {
38103810
ipv6_ac_destroy_dev(idev);
38113811
ipv6_mc_destroy_dev(idev);
38123812
} else {
@@ -3816,7 +3816,7 @@ static int addrconf_ifdown(struct net_device *dev, int how)
38163816
idev->tstamp = jiffies;
38173817

38183818
/* Last: Shot the device (if unregistered) */
3819-
if (how) {
3819+
if (unregister) {
38203820
addrconf_sysctl_unregister(idev);
38213821
neigh_parms_release(&nd_tbl, idev->nd_parms);
38223822
neigh_ifdown(&nd_tbl, dev);
@@ -4038,7 +4038,7 @@ static void addrconf_dad_work(struct work_struct *w)
40384038
in6_ifa_hold(ifp);
40394039
addrconf_dad_stop(ifp, 1);
40404040
if (disable_ipv6)
4041-
addrconf_ifdown(idev->dev, 0);
4041+
addrconf_ifdown(idev->dev, false);
40424042
goto out;
40434043
}
40444044

@@ -7187,9 +7187,9 @@ void addrconf_cleanup(void)
71877187
for_each_netdev(&init_net, dev) {
71887188
if (__in6_dev_get(dev) == NULL)
71897189
continue;
7190-
addrconf_ifdown(dev, 1);
7190+
addrconf_ifdown(dev, true);
71917191
}
7192-
addrconf_ifdown(init_net.loopback_dev, 1);
7192+
addrconf_ifdown(init_net.loopback_dev, true);
71937193

71947194
/*
71957195
* Check hash table.

0 commit comments

Comments
 (0)