Bug 1452684 - cannot set ipv6 route with src
Summary: cannot set ipv6 route with src
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: NetworkManager
Version: 7.4
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Thomas Haller
QA Contact: Desktop QE
URL:
Whiteboard:
Depends On: 1457196
Blocks: 1470965
TreeView+ depends on / blocked
 
Reported: 2017-05-19 13:14 UTC by Vladimir Benes
Modified: 2018-04-10 13:26 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1457196 (view as bug list)
Environment:
Last Closed: 2018-04-10 13:24:24 UTC
Target Upstream Version:


Attachments (Terms of Use)
test script adding route with "src" (507 bytes, text/plain)
2017-05-26 19:27 UTC, Thomas Haller
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:0778 0 None None None 2018-04-10 13:26:21 UTC

Description Vladimir Benes 2017-05-19 13:14:01 UTC
Description of problem:
nmcli con add type ethernet ifname eth1 con-name ethie autoconnect no ipv6.method manual ipv6.addresses 2000::2/126 ipv6.route-metric 256
nmcli con modify ethie ipv6.routes '1010::1/128 src=2000::2'

never works out to full route.

 <error> [1495198700.1398] platform-linux: do-add-ip6-route[4: 1010::1/128 256]: failure 22 (Invalid argument)

Version-Release number of selected component (if applicable):
1.8.0-2

Comment 1 Thomas Haller 2017-05-26 19:27:13 UTC
Created attachment 1282758 [details]
test script adding route with "src"

NetworkManager first adds the IPv6 address, and immediately afterwards the IPv6 route. The route's "src" (RTA_PREFSRC) references the added address.

At that point, the address is still tentative (DAD), and adding the route fails with "Invalid argument".

Then, NM aborts activation because it was unable to configure the route.


I think this is a kernel bug (or at least, ill behavior). How is somebody supposed to write a script that adds a route with "src" set, when he first has to wait until the address becomes non-tenative? Kernel should allow adding the route, and possibly just not use it until the address survives DAD.


Since NM doesn't support the nodad flag for addresses, specifying "src" is broken.

Comment 2 Thomas Haller 2017-05-28 17:18:19 UTC
I don't know how to fix this. I tried a bit with th/route-pref-src-rh1452684, but go nowhere. Beniamino?

Comment 3 Thomas Haller 2017-05-31 09:59:33 UTC
I cloned this bug for kernel (bug 1452684).

It's unclear, whether we should put effort into adding a workaround in NetworkManager. It's complicated, and I think kernel should be fixed.

anyway, I don't think this is gonna make it to rhel-7.4.

Comment 4 Thomas Haller 2017-05-31 10:00:41 UTC
(In reply to Thomas Haller from comment #3)
> I cloned this bug for kernel (bug 1452684).

I cloned this bug for kernel (bug 1457196).

Comment 5 Thomas Haller 2017-09-13 15:02:05 UTC
Please review th/route-pref-src-rh1452684

The solution here is very ugly. Maybe we should just log a meaningful error message and add support for IFA_F_OPTIMISTIC flag, so that the user can configure that.

Comments welcome.

Comment 6 Beniamino Galvani 2017-09-15 13:53:55 UTC
(In reply to Thomas Haller from comment #5)
> Please review th/route-pref-src-rh1452684

+               priv->rt6_temporary_not_available = g_hash_table_new_full ((GHashFunc) nmp_object_id_hash,
+                                                                                  (GEqualFunc) nmp_object_id_equal,
+                                                                                  (GDestroyNotify) nmp_object_unref,
+                                                                                  nm_g_slice_free_fcn (IP6RoutesTemporaryNotAvailableData));

Indentation. The rest LGTM.

> The solution here is very ugly. Maybe we should just log a meaningful error
> message and add support for IFA_F_OPTIMISTIC flag, so that the user can
> configure that.

At the moment kernel doesn't allow adding addresses with the
optimistic flag, which is probably a bug. But once it's fixed,
I think this would be a better solution.

Comment 7 Francesco Giudici 2017-09-15 14:43:06 UTC
th/route-pref-src-rh1452684 looks good

Comment 12 errata-xmlrpc 2018-04-10 13:24:24 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:0778


Note You need to log in before you can comment on or make changes to this bug.