* [PATCH net] ipv4: fix ifa_flags reuse problem in using ifconfig tool
@ 2019-09-04 7:37 Su Yanjun
2019-09-05 10:13 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Su Yanjun @ 2019-09-04 7:37 UTC (permalink / raw)
To: davem, kuznet, yoshfuji; +Cc: netdev, linux-kernel, suyj.fnst
When NetworkManager has already set ipv4 address then uses
ifconfig set another ipv4 address. It will use previous ifa_flags
that will cause device route not be inserted.
As NetworkManager has already support IFA_F_NOPREFIXROUTE flag [1],
but ifconfig will reuse the ifa_flags. It's weird especially
some old scripts or program [2] still use ifconfig.
[1] https://gitlab.freedesktop.org/NetworkManager/NetworkManager/
commit/fec80e7473ad16979af75ed299d68103e7aa3fe9
[2] LTP or TAHI
Signed-off-by: Su Yanjun <suyj.fnst@cn.fujitsu.com>
---
net/ipv4/devinet.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index a4b5bd4..56ca339 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -1159,6 +1159,7 @@ int devinet_ioctl(struct net *net, unsigned int cmd, struct ifreq *ifr)
inet_del_ifa(in_dev, ifap, 0);
ifa->ifa_broadcast = 0;
ifa->ifa_scope = 0;
+ ifa->ifa_flags = 0;
}
ifa->ifa_address = ifa->ifa_local = sin->sin_addr.s_addr;
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net] ipv4: fix ifa_flags reuse problem in using ifconfig tool
2019-09-04 7:37 [PATCH net] ipv4: fix ifa_flags reuse problem in using ifconfig tool Su Yanjun
@ 2019-09-05 10:13 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2019-09-05 10:13 UTC (permalink / raw)
To: suyj.fnst; +Cc: kuznet, yoshfuji, netdev, linux-kernel
From: Su Yanjun <suyj.fnst@cn.fujitsu.com>
Date: Wed, 4 Sep 2019 15:37:47 +0800
> When NetworkManager has already set ipv4 address then uses
> ifconfig set another ipv4 address. It will use previous ifa_flags
> that will cause device route not be inserted.
>
> As NetworkManager has already support IFA_F_NOPREFIXROUTE flag [1],
> but ifconfig will reuse the ifa_flags. It's weird especially
> some old scripts or program [2] still use ifconfig.
>
> [1] https://gitlab.freedesktop.org/NetworkManager/NetworkManager/
> commit/fec80e7473ad16979af75ed299d68103e7aa3fe9
>
> [2] LTP or TAHI
>
> Signed-off-by: Su Yanjun <suyj.fnst@cn.fujitsu.com>
I don't know about this.
This will lose things like IFA_F_SECONDARY as well.
Sorry, I am not convinced that this change is correct nor safe.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-09-05 10:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-04 7:37 [PATCH net] ipv4: fix ifa_flags reuse problem in using ifconfig tool Su Yanjun
2019-09-05 10:13 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.