After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 756356 - [review] properly treat IPv4 peer-addresses in NMPlatform [th/platform-ipv4-peer-address-bgo756356]
[review] properly treat IPv4 peer-addresses in NMPlatform [th/platform-ipv4-p...
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2015-10-10 18:57 UTC by Thomas Haller
Modified: 2015-10-14 14:18 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Thomas Haller 2015-10-10 18:57:05 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.
Comment 1 Dan Williams 2015-10-13 16:16:05 UTC
> 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?
Comment 2 Thomas Haller 2015-10-14 14:18:42 UTC
(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