Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 8088 - dhclient fails to recognize -nw option
Summary: dhclient fails to recognize -nw option
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: SpanKY
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-09-18 21:01 UTC by David Mitchell
Modified: 2002-09-25 09:21 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Mitchell 2002-09-18 21:01:55 UTC
The dhclient binary in the net-misc/dhcp package fails to recognize the -nw   
option, printing out usage information instead of accepting the option. This   
is actually an upstream bug in the original ISC code which is fixed in the  
3.0.1rc9 upstream version. However, until 3.0.1 is included in Gentoo, it  
would be nice to patch the bug in the 3.0pl1 version currently included in  
Gentoo.  
  
The following patch can be applied to fix the problem:  
-----quote-------  
diff -rc ./dhcp-3.0pl1/client/dhclient.c dhcp-3.0pl1-fixed/client/dhclient.c  
*** ./dhcp-3.0pl1/client/dhclient.c     Wed Aug  8 08:46:14 2001  
--- dhcp-3.0pl1-fixed/client/dhclient.c Wed Sep 18 13:32:32 2002  
***************  
*** 198,205 ****  
                } else if (!strcmp (argv [i], "-w")) {  
                        /* do not exit if there are no broadcast interfaces.  
*/  
                        persist = 1;  
-               } else if (argv [i][0] == '-') {  
-                   usage ();  
                } else if (!strcmp (argv [i], "-e")) {  
                        struct string_list *tmp;  
                        if (++i == argc)  
--- 198,203 ----  
***************  
*** 216,221 ****  
--- 214,221 ----  
                        exit (0);  
                } else if (!strcmp (argv [i], "-nw")) {  
                        nowait = 1;  
+               } else if (argv[i][0] == '-') {  
+                       usage ();  
                } else {  
                    struct interface_info *tmp = (struct interface_info *)0;  
                    status = interface_allocate (&tmp, MDL);  
------end quote------  
  
A simple addition of the patch application to the ebuild completes the fix:  
  
-----quote--------  
 src_unpack() { 
        unpack ${A} 
        cd ${S} 
        patch -p1 < ${FILESDIR}/dhcp-3.0pl1-r4-gentoo.patch || die 
        cd ${S}/includes 
        cat <<- END >> site.h 
-----end quote--------
Comment 1 Martin Schlemmer (RETIRED) gentoo-dev 2002-09-21 00:22:27 UTC
Guys, get somebody who uses dhcp ....
Comment 2 SpanKY gentoo-dev 2002-09-21 15:24:10 UTC
next time post your patches and such as attachements ;)

bugzilla doesnt handle displaying patches properly (too many spaces, not enough 
tabs, etc...)
Comment 3 SpanKY gentoo-dev 2002-09-21 15:56:59 UTC
comitted to cvs ... check out -r4 to see if it fixes your problem

if it works for you, close this bug ;)