Fix dhclient option order to avoid errors
authorRichard Purdie <rpurdie@linux.intel.com>
Tue, 26 May 2009 09:19:27 +0000 (10:19 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Tue, 26 May 2009 09:32:41 +0000 (11:32 +0200)
When dhclient is called, it expects to see the interface name before
any -n option. If this doesn't happen it will just print usage
information.

This patch changes the dhclient option order so the interface comes
before -n and works with the standard dhcp 4.1.0 source.

plugins/dhclient.c

index 432878a..ca9b621 100644 (file)
@@ -165,18 +165,18 @@ static int dhclient_probe(struct connman_element *element)
        argv[0] = DHCLIENT;
        argv[1] = "-d";
        argv[2] = "-q";
-       argv[3] = "-n";
-       argv[4] = "-e";
-       argv[5] = address;
-       argv[6] = "-pf";
-       argv[7] = pidfile;
-       argv[8] = "-lf";
-       argv[9] = leases;
-       argv[10] = "-cf";
-       argv[11] = config;
-       argv[12] = "-sf";
-       argv[13] = script;
-       argv[14] = task->ifname;
+       argv[3] = "-e";
+       argv[4] = address;
+       argv[5] = "-pf";
+       argv[6] = pidfile;
+       argv[7] = "-lf";
+       argv[8] = leases;
+       argv[9] = "-cf";
+       argv[10] = config;
+       argv[11] = "-sf";
+       argv[12] = script;
+       argv[13] = task->ifname;
+       argv[14] = "-n";
        argv[15] = NULL;
 
        envp[0] = NULL;