On Sat, May 27, 2017 at 10:29:18AM +0800, Hunt Xu wrote: > On Fri, May 26, 2017 at 11:46 PM, Ben Pfaff <b...@ovn.org> wrote: > > It's becoming more common that OSes include "ip" but not "ifconfig", so > > it's best to avoid using the latter. This commit removes most references > > to "ifconfig" and replaces them by "ip". It also adds a build-time check > > to make it harder to introduce new uses of "ifconfig". > > > > Signed-off-by: Ben Pfaff <b...@ovn.org> > > --- > > <snip> > > > diff --git a/Documentation/faq/issues.rst b/Documentation/faq/issues.rst > > index c60336a10569..82d0605da125 100644 > > --- a/Documentation/faq/issues.rst > > +++ b/Documentation/faq/issues.rst > > @@ -43,8 +43,8 @@ eth0. Help! > > itself. For example, assuming that eth0's IP address is > > 192.168.128.5, you > > could run the commands below to fix up the situation:: > > > > - $ ifconfig eth0 0.0.0.0 > > - $ ifconfig br0 192.168.128.5 > > + $ ip addr flush dev eth0 > > + $ ip addr add 192.168.128.5 dev br0 > > ip addr add 192.168.128.5/24 dev br0 > > It seems using ifconfig without specifying any netmask the netmask/prefixlen > will still be properly set (not diving quite deep, but strace indicates that > this is not done by ifconfig, ifconfig don't even try to set the netmask), > whlie using ip-address with only the address specified the prefixlen is > always 32. > > Some tests on my Ubuntu 16.04: > 1a. ifconfig br0 192.168.128.5 -> br0 gets 192.168.128.5/24 > 1b. ip addr add 192.168.128.5 dev br0 -> br0 gets 192.168.128.5/32 > 2a. ifconfig br0 172.16.128.5 -> br0 gets 172.16.128.5/16 > 2b. ip addr add 172.16.128.5 dev br0 -> br0 gets 172.16.128.5/32 > 3a. ifconfig br0 10.0.128.5 -> br0 gets 10.0.128.5/8 > 3b. ip addr add 10.0.128.5 dev br0 -> br0 gets 10.0.128.5/32
Thanks a lot for the review. I fixed what you pointed out and posted a v4: https://mail.openvswitch.org/pipermail/ovs-dev/2017-May/333131.html _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev