diff options
author | Gurucharan Shetty <guru@ovn.org> | 2017-10-18 22:38:23 -0700 |
---|---|---|
committer | Gurucharan Shetty <guru@ovn.org> | 2017-10-20 02:06:59 -0700 |
commit | a6480fc6aab331e21c9bf9cd115687ceeb484fb8 (patch) | |
tree | e93aeb5ba5f6762e953c6313e5c510455dfac8aa /utilities | |
parent | 01d630280078991384544b4dae8f6127806cce3c (diff) | |
download | openvswitch-a6480fc6aab331e21c9bf9cd115687ceeb484fb8.tar.gz |
ovs-save: Handle different 'ip addr show' output.
On RHEL 7.4 (with iproute-3.10.0-87), a DHCP provided
ipv4 address has the "dynamic" keyword set. For e.g
"ip addr show breth0 | grep inet" shows:
inet 10.116.248.91/20 brd 10.116.255.255 scope global dynamic breth0
inet6 fe80::250:56ff:fea8:fdf0/64 scope link
The keyword "dynamic" (according to 'man ip-address') is only
used for ipv6, but in this case this is not true. Our current
code will skip the ipv4 address restoration because of this.
With this commit, we special case "dynamic" keyword to be valid
in case of ipv4.
VMware-BZ: #1982196
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
Acked-by: Yi-Hung Wei <yihung.wei@gmail.com>
Diffstat (limited to 'utilities')
-rw-r--r-- | utilities/ovs-lib.in | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/utilities/ovs-lib.in b/utilities/ovs-lib.in index 8665698bb..ac2da85b7 100644 --- a/utilities/ovs-lib.in +++ b/utilities/ovs-lib.in @@ -329,6 +329,14 @@ move_ip_address () { while test $# != 0; do case $1 in dynamic) + # XXX: According to 'man ip-address', "dynamic" is only + # used for ipv6 addresses. But, atleast on RHEL 7.4 + # (iproute-3.10.0-87), it is being used for ipv4 + # addresses assigned with dhcp. + if [ "$family" = "inet" ]; then + shift + continue + fi # Omit kernel-maintained route. continue 2 ;; |