netifd: don't send a default client identifier in DHCP requests if no clientid uci...
authorjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Mon, 5 Nov 2012 19:28:24 +0000 (19:28 +0000)
committerjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Mon, 5 Nov 2012 19:28:24 +0000 (19:28 +0000)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@34089 3c298f89-4303-0410-b956-a3cf2f4a3e73

package/network/config/netifd/files/lib/netifd/proto/dhcp.sh

index 7b1fe37..3830878 100755 (executable)
@@ -27,6 +27,7 @@ proto_dhcp_setup() {
        done
 
        [ "$broadcast" = 1 ] && broadcast="-B" || broadcast=
        done
 
        [ "$broadcast" = 1 ] && broadcast="-B" || broadcast=
+       [ -n "$clientid" ] && clientid="-x 0x3d:${clientid//:/}" || clientid="-C"
 
        proto_export "INTERFACE=$config"
        proto_run_command "$config" udhcpc \
 
        proto_export "INTERFACE=$config"
        proto_run_command "$config" udhcpc \
@@ -35,9 +36,8 @@ proto_dhcp_setup() {
                -f -t 0 -i "$iface" \
                ${ipaddr:+-r $ipaddr} \
                ${hostname:+-H $hostname} \
                -f -t 0 -i "$iface" \
                ${ipaddr:+-r $ipaddr} \
                ${hostname:+-H $hostname} \
-               ${clientid:+-x 0x3d:${clientid//:/}} \
                ${vendorid:+-V $vendorid} \
                ${vendorid:+-V $vendorid} \
-               $broadcast $dhcpopts
+               $clientid $broadcast $dhcpopts
 }
 
 proto_dhcp_teardown() {
 }
 
 proto_dhcp_teardown() {