On Tuesday 31 May 2011 17:37, Nigel Hathaway wrote:
> Package: busybox
> Version: v1.18.4
> Severity: low
> 
> This patch applies on top of my previous VLAN and numeric DHCP option 
> recognition patch.
> 
> Whist this previous patch allows you to have DHCP options that are unknown to 
> Busybox to be passed numerically to the udhcpc script, I found that there was 
> no way of actually adding them to the list of requested options passed to the 
> DHCP server. This rectifies this in that you can now request DHCP options by 
> number. For example:
> 
> udhcpc -O43
> 
> This adds option 43 (vendor specific information) to the set of requested 
> options.

I committed a smaller fix for now:

diff -ad -urpN busybox.5/networking/udhcp/dhcpc.c 
busybox.6/networking/udhcp/dhcpc.c
--- busybox.5/networking/udhcp/dhcpc.c  2011-05-16 03:51:39.000000000 +0200
+++ busybox.6/networking/udhcp/dhcpc.c  2011-06-04 05:06:47.000000000 +0200
@@ -1134,8 +1134,11 @@ int udhcpc_main(int argc UNUSED_PARAM, c
                client_config.no_default_options = 1;
        while (list_O) {
                char *optstr = llist_pop(&list_O);
-               unsigned n = udhcp_option_idx(optstr);
-               n = dhcp_optflags[n].code;
+               unsigned n = bb_strtou(optstr, NULL, 0);
+               if (errno || n > 254) {
+                       n = udhcp_option_idx(optstr);
+                       n = dhcp_optflags[n].code;
+               }
                client_config.opt_mask[n >> 3] |= 1 << (n & 7);
        }
        while (list_x) {


Let me know if it's not enough.

-- 
vda
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to