GNOME Bugzilla – Bug 721420
MTU from DHCP/PPP/VPN configs not being respected
Last modified: 2014-04-22 09:05:11 UTC
The MTU from various IP configuration methods isn't carried through to the final IP config that gets committed for a link. The MTU will get set correctly on the DHCP/PPP/VPN generated NMIP4Config but when merging all the configurations in ip4_config_merge_and_apply(), nm_ip4_config_merge() doesn't merge the MTU like it does for the MSS. What should probably happen here is: 1) nm_ip4_config_merge() should merge the MTU from 'src' if src's MTU is non-zero. 2) nm_ip4_config_subtract() should set 'dst' MTU to zero if dst's MTU equals src's MTU 3) testcases should be added to ensure that merge and subtract operations do the right thing with the MTU for single and multiple merges
The code is ready for a review in jk/bgo721420-mtu branch.
+ /* add MSS, MTU to configs to test them */ + nm_ip4_config_set_mss (cfg2, expected_mss2); + nm_ip4_config_set_mtu (cfg2, expected_mtu2); + nm_ip4_config_set_mtu (cfg3, expected_mss3); + nm_ip4_config_set_mtu (cfg3, expected_mtu3); Should the third call here be set_mss()? It doesn't effect the final result because cfg1 already has an MSS set to the MSS in cfg3 gets ignored, but should probably get fixed. Rest looks good!
(In reply to comment #2) > + /* add MSS, MTU to configs to test them */ > + nm_ip4_config_set_mss (cfg2, expected_mss2); > + nm_ip4_config_set_mtu (cfg2, expected_mtu2); > + nm_ip4_config_set_mtu (cfg3, expected_mss3); > + nm_ip4_config_set_mtu (cfg3, expected_mtu3); > > Should the third call here be set_mss()? It doesn't effect the final result > because cfg1 already has an MSS set to the MSS in cfg3 gets ignored, but should > probably get fixed. > Of course, it should. Fixed. Commit in master: 0757e33 core: fix MTU handling while merging/subtracting IP configs (bgo #721420)