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 728595 - link-local addresses should configure a link scope instead of global scope
link-local addresses should configure a link scope instead of global scope
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: IP and DNS config
0.9.8
Other Linux
: Normal normal
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2014-04-20 09:52 UTC by Peter Wu
Modified: 2014-04-28 08:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Set link scope for IP4LL addresses (based on 0.9.8.9) (1.49 KB, patch)
2014-04-21 15:17 UTC, Peter Wu
reviewed Details | Review
Set link scope for IP4LL addresses (based on 0.9.9.1.x) (1.30 KB, patch)
2014-04-21 15:23 UTC, Peter Wu
reviewed Details | Review

Description Peter Wu 2014-04-20 09:52:17 UTC
When NetworkManager is configured to assign a link-local IPv4 address to an interface, it ends up with a global scope. This happens in two cases:

 - Configure method=link-local
 - Configure method=manual, addresses1=169.254.x.x;16:0.0.0.0

$ ip link show dev <iface>  # for both methods
    inet 169.254.x.y/16 brd 169.254.255.255 scope global <iface>
       valid_lft forever preferred_lft forever

Expected output:
    inet 169.254.x.y/16 brd 169.254.255.255 scope link <iface>
       valid_lft forever preferred_lft forever

This behavior causes conflicts with two network interfaces having the same _link-local_ address.
Comment 1 Peter Wu 2014-04-20 09:54:06 UTC
Additional details about distro/version:

Arch Linux - networkmanager 0.9.8.8-1 (method=link-local)
Kubuntu 14.04 - network-manager 0.9.8.8-0ubuntu7 (method=manual)
Comment 2 Peter Wu 2014-04-21 15:17:46 UTC
Created attachment 274809 [details] [review]
Set link scope for IP4LL addresses (based on 0.9.8.9)

This is a patch for the 0.9.8.9 series. It was tested on top of Ubuntu's 0.9.8.8-0ubuntu7.
Comment 3 Peter Wu 2014-04-21 15:23:20 UTC
Created attachment 274811 [details] [review]
Set link scope for IP4LL addresses (based on 0.9.9.1.x)

Note: untested.

After applying the previous patch, the scope changes from "scope global" to "scope link". Unfortunately, it did not fix the actual issue I was having. I can still not assign the same address to two interfaces, it simply does not generate ARP responses for one of the interfaces.

(different issue)
Pinging on the same host does not work either. That is, given:
- eth1: 169.254.a.b
- eth2: 169.254.c.d

These do not trigger ARP responses:

- ping 169.254.c.d -I eth2
- ping 169.254.a.b -I eth1
Comment 4 Dan Williams 2014-04-25 15:43:05 UTC
Review of attachment 274811 [details] [review]:

Looks good to me.
Comment 5 Dan Williams 2014-04-25 15:43:51 UTC
Review of attachment 274809 [details] [review]:

Looks good to me.
Comment 6 Dan Williams 2014-04-25 15:44:18 UTC
Lets get another review of both of these too though.
Comment 7 Thomas Haller 2014-04-25 16:01:27 UTC
Both patches look to me good as well.

The one from master branch, could drop the braces around the if, but never mind...
Comment 8 Dan Williams 2014-04-25 16:20:01 UTC
Thanks Thomas, feel free to merge these if you've got a bit of time.
Comment 9 Thomas Haller 2014-04-27 15:14:04 UTC
Both patches applied.

Note that I reworded the commit messages and modified the patches
(on master: coding style, remove the braces around if;
on nm-0.9.8: add missing #include).


http://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=a2eb4789ac2fe8a6389aabb83285bc667b86d941

http://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=3a409a8ccc7ff90ca411014a33f0ce4d59ba040c
Comment 10 Peter Wu 2014-04-27 18:42:38 UTC
The 0.9.8.x patch compiled fine for me without that header (Ubuntu 14.04).

Thanks for merging.
Comment 11 Thomas Haller 2014-04-28 08:45:42 UTC
(In reply to comment #10)
> The 0.9.8.x patch compiled fine for me without that header (Ubuntu 14.04).

Interesting... It didn't compile for me, Fedora 20... anyway :)