Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 555974

Summary: <=net-misc/dhcpcd-6.9.1 resets mtu erroneously
Product: Gentoo Linux Reporter: Matthew Thode ( prometheanfire ) <prometheanfire>
Component: Current packagesAssignee: William Hubbs <williamh>
Status: RESOLVED FIXED    
Severity: normal CC: base-system, roy
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: https://github.com/prometheanfire/gentoo-cloud-prep/issues/15
Whiteboard:
Package list:
Runtime testing required: ---

Description Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2015-07-26 20:21:13 UTC
This seems to be fixed in master, but I'm not sure by which commit (or I'd pull it out).

This is specifically effecting my dual stack setup, both v4 and v6 advertise a 1450 MTU but it gets reset to 1500.

Jul 26 20:10:32 test-hostname2 dhcpcd-run-hooks[3727]: eth0: MTU set to 1450
Jul 26 20:10:32 test-hostname2 dhcpcd-run-hooks[3748]: eth0: MTU restored to 1500
Comment 1 Roy Marples 2015-07-26 21:09:40 UTC
I think this is the same as bug #554422.
Comment 2 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2015-07-26 21:20:32 UTC
I'll test that patch then
Comment 3 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2015-07-26 21:31:11 UTC
at first glance this seems to work, I'm gonna keep the machine up til the VM asks for a renewed lease to be sure.
Comment 4 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2015-07-26 21:37:18 UTC
it was just reset again, ran 6.9.1 with this patch
http://roy.marples.name/projects/dhcpcd/vpatch?from=bba0ca7ae99aeae9&to=2a1546e5869468f1
Comment 5 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2015-07-26 21:47:44 UTC
9999 resets itself as well, so this effects master :(
Comment 6 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2015-07-26 23:01:42 UTC
Here's some more debug info

# command to generate debug info (interface is the VMs interface):
tshark -i tapcd6b2718-7f -Y "icmpv6.type == 133 or icmpv6.type == 134 or icmpv6.type == 135" -T fields -e frame.number -e icmpv6.type -e ipv6.src -e ipv6.dst -e icmpv6.mtu -e icmpv6.opt.mtu -E header=y -E separator=\;

# command output upon radvd restart
1;134;fe80::26a4:3cff:fe06:d8fe;ff02::1;;1450
4;134;fe80::26a4:3cff:fe06:d8fe;ff02::1;;1450

# dhcpcd debug log upon radvd restart
Jul 26 22:51:27 test-hostname2 dhcpcd[3300]: eth0: Router Advertisement from fe80::26a4:3cff:fe06:d8fe
Jul 26 22:51:27 test-hostname2 dhcpcd[3300]: eth0: adding address 2001:470:e1cc:1:f816:3eff:fed6:21ea/64
Jul 26 22:51:27 test-hostname2 dhcpcd[3300]: eth0: pltime 604800 seconds, vltime 2592000 seconds
Jul 26 22:51:27 test-hostname2 dhcpcd[3300]: eth0: executing `/lib/dhcpcd/dhcpcd-run-hooks' ROUTERADVERT
Jul 26 22:51:27 test-hostname2 dhcpcd-run-hooks[3771]: eth0: MTU restored to 1500



To me it seems like dhcpcd is simply ignoring the ipv6 MTU (specifically the 'icmpv6.opt.mtu' option), so it's being reset.  The only reason it's set correctly at all is because MTU is also advertised via ipv4.

Perhaps dhcpcd only sets the MTU based on the 'icmpv6.mtu' option and not the 'icmpv6.opt.mtu' option (they could be different ways of saying the same thing for all I know)?
Comment 7 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2015-07-27 00:17:34 UTC
just for more docs...

https://gist.github.com/prometheanfire/22bb0b6f77c904ca8c1d
Comment 8 Roy Marples 2015-07-27 10:48:43 UTC
Hopefully fixed here:
http://roy.marples.name/projects/dhcpcd/ci/5e375e2d3180d184?sbs=0
Comment 9 William Hubbs gentoo-dev 2015-07-27 15:50:18 UTC
@prometheanfire:
Can you test master again please and let me know if the issue is
resolved?
Comment 10 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2015-07-27 15:58:16 UTC
It's tested good for me.
Comment 11 Roy Marples 2015-07-29 15:04:53 UTC
Could you test again using a new 9999 ebuild please?
I have taken a different tack by removing the 10-mtu hook script and directly applying the MTU to each route generated by the DHCP message, which is similar to IPv6.

This is probably a more robust method of doing this as it has the side effect of avoiding a PHY reset on some hardware/drivers when changing the MTU which can cause an infinite loop.
Comment 12 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2015-07-29 15:35:30 UTC
seems to work just fine.  I assume that if the interface mtu is lower then the route MTU that'll be obeyed, thanks for the quick work
Comment 13 Roy Marples 2015-07-29 19:57:06 UTC
(In reply to Matthew Thode ( prometheanfire ) from comment #12)
> seems to work just fine.  I assume that if the interface mtu is lower then
> the route MTU that'll be obeyed, thanks for the quick work

The lowest MTU of the two will be used.
Comment 14 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2015-07-29 19:58:28 UTC
right, and that's an in kernel thing, :D
Comment 15 Roy Marples 2015-07-29 20:00:36 UTC
Exactly
Comment 16 Roy Marples 2015-08-21 10:49:50 UTC
dhcpcd-6.9.2 has been released which fixes this issue
Comment 17 William Hubbs gentoo-dev 2015-08-25 16:04:15 UTC
dhcpcd-6.9.2 is now in the tree.