Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 524156 - net-misc/netifrc - add support for RFC 3442 / Classless Static Route Option to udhcpc
Summary: net-misc/netifrc - add support for RFC 3442 / Classless Static Route Option t...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: netifrc Team
URL:
Whiteboard: netifrc:dhcp netifrc:udhcpc
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2014-09-30 19:25 UTC by Jack Suter
Modified: 2016-10-24 22:27 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch for RFC 3442 support in udhcpc script (udhcpc-rfc-3442.patch,1.12 KB, patch)
2014-09-30 19:26 UTC, Jack Suter
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jack Suter 2014-09-30 19:25:46 UTC
The attached patch adds support for RFC 3442 (the Classless Static Route Option for DHCP) to udhcpc. The majority of it was taken from the default.script file for OpenWRT [1].

This patch has been tested and confirmed to work on my setup (DHCP server sending option 121 to set a static route for a gateway outside the subnet).

It's worth noting that per the RFC, we must also request this parameter from the DHCP server. This patch does not add support for that, so update_classless_routes() would only run if a DHCP server forced the parameter.
   DHCP clients that support this option and that send a DHCP Parameter
   Request List option MUST request both this option and the Router
   option in the DHCP Parameter Request List.

It looks like a possible place to request the option would be in /lib/netifrc/net/udhcpc.sh, although I feel there is likely a better place for it.

[1] https://github.com/openwrt-mirror/openwrt/blob/master/package/network/config/netifd/files/usr/share/udhcpc/default.script

Reproducible: Always

Steps to Reproduce:
1. Configure DHCP server to send option 121 (Classless Static Route)
2. Boot Gentoo and have udhcpc request an IP address
3. Observe that option 121 is ignored, even when the DHCP server forces the option to be sent.
Actual Results:  
Static route was ignored.

Expected Results:  
Static route was processed and added to routing table.
Comment 1 Jack Suter 2014-09-30 19:26:34 UTC
Created attachment 385842 [details, diff]
Patch for RFC 3442 support in udhcpc script
Comment 2 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2016-10-24 22:26:39 UTC
[master 8a92e2a] sh/udhcpc-hook.sh: classless static routes
 1 file changed, 25 insertions(+), 1 deletion(-)