GNOME Bugzilla – Bug 756356
[review] properly treat IPv4 peer-addresses in NMPlatform [th/platform-ipv4-peer-address-bgo756356]
Last modified: 2015-10-14 14:18:42 UTC
Please review QUOTING COMMIT MESSAGE: platform: properly handle peer-address for IPv4 addresses Kernel allows to add the same address with different peer-address (IFL_ADDRESS): $ ip link add dummy type dummy $ ip address add 1.1.1.1 peer 1.1.1.3/24 dev dummy $ ip address add 1.1.1.1 peer 1.1.1.4/24 dev dummy RTNETLINK answers: File exists $ ip address add 1.1.1.1 peer 1.1.2.3/24 dev dummy $ ip address show dev dummy 2: dummy@NONE: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN group default link/ether 52:58:a7:1e:e8:93 brd ff:ff:ff:ff:ff:ff inet 1.1.1.1 peer 1.1.1.3/24 scope global dummy valid_lft forever preferred_lft forever inet 1.1.1.1 peer 1.1.2.3/24 scope global dummy valid_lft forever preferred_lft forever We must also consider peer-address, otherwise platform will treat two different addresses as one and the same.
> ip-config: refactor to use _addresses_get_index() function Should the addresses_are_duplicate() changes go in the previous patch and if so, should the previous patch get renamed to not be IPv4 specific? > platform: properly handle peer-address for IPv4 addresses Should the testcases get updated to make sure that the matching works when the peer address is the same but prefix is different?
(In reply to Dan Williams from comment #1) > > ip-config: refactor to use _addresses_get_index() function > > Should the addresses_are_duplicate() changes go in the previous patch and if > so, should the previous patch get renamed to not be IPv4 specific? I did it so, that the first patch is a change in behavior. For example, you would see on D-Bus interface, that now we expose two addresses if they differ by prefix. Previously we wouldn't. The second patch is only refactoring. > > platform: properly handle peer-address for IPv4 addresses > > Should the testcases get updated to make sure that the matching works when > the peer address is the same but prefix is different? Did a major patch with cleanup of testing code (including more asserts). This also tests IPv4 peers. Merged: http://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=master