Hi experts,<br><br>I have a question on '-n' option of the dhclient program,<br>from version dhcp-4.0.1 the handling of '-n' option<br>of the dhclient changed, <br><br>version previous to dhcp-4.0.1 the below command works<br>
as expeced<br>dhclient -n -w  <br><br>from version dhcp-4.0.1 the below command fails like following<br>dhclient -n -w ethX<br><br>print usage messages and exit<br><br>the dhclient will initialise all interfaces but not just ethX specified<br>
in the command line<br>dhclient -w ethX -n<br><br>Namely, the location of the '-n' option on the command line has<br>effect on the functionality of the option, for the reason 'if .. else if'<br>statement in C language has priority,<br>
<br>for (i = 1; i < argc; i++) {<br>   } else if (!strcmp(argv[i], "-n")) {<br>                        /* do not start up any interfaces */<br>                        interfaces_requested = -1;<br>   } else if (argv[i][0] == '-') {<br>
                    usage();<br>                } else if (interfaces_requested < 0) {<br>                    usage();<br>   } else {<br><br><br>Handling the '-n' option like this is designed behaviour or a hidden bug?<br>
If its designed to be so, why the location of the option has impacts<br>on its functionality? I am confused, would you help me out?<br><br>Thanks<br>bhs<br><br><br>