[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20151030.121812.1043202779633665864.davem@davemloft.net>
Date:	Fri, 30 Oct 2015 12:18:12 +0900 (KST)
From:	David Miller <davem@...emloft.net>
To:	ja@....bg
Cc:	netdev@...r.kernel.org, gospo@...ulusnetworks.com
Subject: Re: [PATCHv2 net 1/2] ipv4: fix to not remove local route on link
 down
From: Julian Anastasov <ja@....bg>
Date: Mon, 26 Oct 2015 23:59:12 +0200
 ...
> -int fib_sync_down_dev(struct net_device *dev, unsigned long event)
> +/* Event              force Flags           Description
> + * NETDEV_CHANGE      0     LINKDOWN        Carrier OFF, not for scope host
> + * NETDEV_DOWN        0     LINKDOWN|DEAD   Link down, not for scope host
> + * NETDEV_DOWN        1     LINKDOWN|DEAD   Last address removed
> + * NETDEV_UNREGISTER  2     LINKDOWN|DEAD   Device removed
> + */
> +int fib_sync_down_dev(struct net_device *dev, unsigned long event, int force)
>  {
>  	int ret = 0;
>  	int scope = RT_SCOPE_NOWHERE;
> @@ -1290,8 +1296,7 @@ int fib_sync_down_dev(struct net_device *dev, unsigned long event)
>  	struct hlist_head *head = &fib_info_devhash[hash];
>  	struct fib_nh *nh;
>  
> -	if (event == NETDEV_UNREGISTER ||
> -	    event == NETDEV_DOWN)
> +	if (force)
>  		scope = -1;
Julian the force variable is only used in a boolean manner, and in
fact 'event' + a boolean is enough to distinguish all of the necessary
cases so really using a non-bool for 'force' does not convey any extra
information.
So please use 'bool' and 'true/false' for 'force'.
Thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists