Bug 1365915 - systemd-networkd misconfigures routing table when restarted
Summary: systemd-networkd misconfigures routing table when restarted
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: systemd
Version: 24
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: systemd-maint
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-10 13:31 UTC by Michael Chapman
Modified: 2017-08-08 16:23 UTC (History)
8 users (show)

Fixed In Version: systemd-229-12.fc24
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-08 16:23:02 UTC
Type: Bug


Attachments (Terms of Use)
networkd: do not add route for zero-lifetime RAs (1.05 KB, patch)
2016-08-19 07:05 UTC, Michael Chapman
no flags Details | Diff

Description Michael Chapman 2016-08-10 13:31:26 UTC
Upstream bug report: https://github.com/systemd/systemd/issues/3352

This bug was encountered in systemd-229-11.fc24.x86_64, though I strongly suspect it also affects the -9 release currently in F24 stable.

When systemd-networkd is restarted, it misconfigures the routing table:

  # ip route
  default via 10.1.1.254 dev eth0  proto static 
  10.1.1.0/24 dev eth0  proto kernel  scope link  src 10.1.1.6 
  # systemctl restart systemd-networkd.service
  # ip route
  10.1.1.0/24 dev eth0  proto kernel  scope link  src 10.1.1.6 

The new routing table is missing the "default" route. In my logs I have:

  Aug 10 23:19:47 myhostname systemd-networkd[1733]: eth0: Could not drop address: No such process

The problem only goes away if the table is manually flushed and systemd-networkd is restarted again.

Comment 1 Jóhann B. Guðmundsson 2016-08-10 13:45:32 UTC
This was fixed upstream here 

https://github.com/systemd/systemd/issues/3352

Zbigniew does systemd-229-11.fc24 fix this as well or do you need to backport it and do another build?

Comment 2 Zbigniew Jędrzejewski-Szmek 2016-08-10 13:55:58 UTC
Blimey. I fired of a rebuild.

Comment 3 Michael Chapman 2016-08-10 14:02:17 UTC
(In reply to Zbigniew Jędrzejewski-Szmek from comment #2)
> Blimey. I fired of a rebuild.

Sorry about that. Only just noticed the problem when testing your previous build. :-)

Comment 4 Fedora Update System 2016-08-10 15:21:47 UTC
systemd-229-12.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-10e709e870

Comment 5 Fedora Update System 2016-08-10 15:21:56 UTC
systemd-229-12.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-10e709e870

Comment 6 Fedora Update System 2016-08-11 03:25:11 UTC
systemd-229-12.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-10e709e870

Comment 7 Michael Chapman 2016-08-11 04:21:28 UTC
So I think there might be a *different* bug causing the same symptoms. With the -12 package, restarting systemd-networkd works correctly only about half of the time. The other times the default route is missing.

Some kind of timing issue perhaps?

I'm certainly not getting the "Could not drop address: No such process" error any more though.

Comment 8 Fedora Update System 2016-08-11 21:54:01 UTC
systemd-229-12.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.

Comment 9 Michael Chapman 2016-08-19 07:05:40 UTC
Created attachment 1192049 [details]
networkd: do not add route for zero-lifetime RAs

So I've tracked down the cause of this problem.

My network has an IPv6 router, but it is not a *default* router. It periodically sends out router advertisements with lifetime=0sec. (This is compliant with RFC 2461.)

F24 networkd creates and immediately expires a route for the router. This can happen while the link is being configured -- that is, before it's finished adding all static addresses and routes to the link. The route_expire_callback function uses the same "pending netlink messages" counter as the link configuration... it is possible for this counter to hit zero in route_expire_callback, and the link configuration state machine won't notice. The end result is that the link may not reach the "adding static routes" step.

This is not actually a bug in upstream systemd, as the networkd code was largely refactored after F24's version. Nevertheless, I did find a few other problems with the code current systemd HEAD -- I've sent those upstream at https://github.com/systemd/systemd/pull/3990.

For F24 I think we really need the second patch in that series ("networkd: do not touch link_messages when expiring routes"). I also think we need the attached patch, which ensures networkd does not even *attempt* to set up a default route for an IPv6 route advertisement with lifetime=0sec.

Comment 10 Michael Chapman 2016-09-30 11:07:06 UTC
Ping?

(I don't mind that it got missed out in the latest systemd updates, what with more important bugfixes going in... but it is a tad annoying having to rebuild my own packages each time. :-p )

Comment 11 Michael Chapman 2016-10-26 07:08:54 UTC
Polite ping?

Comment 12 Fedora End Of Life 2017-07-25 22:20:37 UTC
This message is a reminder that Fedora 24 is nearing its end of life.
Approximately 2 (two) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 24. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '24'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 24 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 13 Fedora End Of Life 2017-08-08 16:23:02 UTC
Fedora 24 changed to end-of-life (EOL) status on 2017-08-08. Fedora 24 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


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