On 2016-01-20 19:21, [email protected] wrote: > From: Daniel Dickinson <[email protected]> > > v3: Drop comment thanking user who gave mask2cidr at their > request > : Fix echo had correct CIDR but actual command did not > : Fix style issue > : Use full -family in ip command line instead of -f > > v2: Also update previously missed deconfig use of ifconfig > : Replace ipcalc.sh callout with pure shell mask2cidr > : Remove unused local variable > > ip from busybox is now standard and it would be good to > eventually drop the ancient and 10+ year deprecated > upstream commands ifconfig and route, so eliminate > one of the last consumers of ifconfig and route in > the base system. > > Signed-off-by: Daniel Dickinson <[email protected]> > --- > .../netifd/files/usr/share/udhcpc/default.script | 34 > +++++++++++++++------- > 1 file changed, 23 insertions(+), 11 deletions(-) > > diff --git > a/package/network/config/netifd/files/usr/share/udhcpc/default.script > b/package/network/config/netifd/files/usr/share/udhcpc/default.script > index ac765a6..5eeeec0 100755 > --- a/package/network/config/netifd/files/usr/share/udhcpc/default.script > +++ b/package/network/config/netifd/files/usr/share/udhcpc/default.script > @@ -1,34 +1,46 @@ > setup_interface() { > - echo "udhcpc: ifconfig $interface $ip netmask ${subnet:-255.255.255.0} > broadcast ${broadcast:-+}" > - ifconfig $interface $ip netmask ${subnet:-255.255.255.0} broadcast > ${broadcast:-+} > + local CIDR > + > + mask2cidr ${subnet:-255.255.255.0} > + > + echo "udhcpc: ip address add $ip/${CIDR} ${broadcast:-+} dev $interface" > + ip address add $ip/${CIDR} ${broadcast:-+} dev $interface" This doesn't work. Did you test this code?
- Felix _______________________________________________ openwrt-devel mailing list [email protected] https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
