Wind River Support Network

HomeDefectsLIN6-8413
Fixed

LIN6-8413 : CLONE - Broadcast address is not assigned when invoking udhcpc along with ip command

Created: Sep 14, 2014    Updated: Dec 3, 2018
Resolved Date: Sep 14, 2014
Previous ID: LIN5-19456
Found In Version: 6.0
Fix Version: 6.0.0.12
Severity: Standard
Applicable for: Wind River Linux 6
Component/s: Networking

Description

When using udhcpc along with ip command(/sbin/ip), broadcast address is not assigned.
Broadcast address is successfully assigned when using udhcpc without ip command existence.

- w ip command
eth0      Link encap:Ethernet  HWaddr 00:01:AF:30:9D:28  
          inet addr:128.224.232.234  Bcast:0.0.0.0  Mask:255.255.254.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:74582 errors:0 dropped:18682 overruns:0 frame:0
          TX packets:531 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:6893150 (6.5 MiB)  TX bytes:125727 (122.7 KiB)
          Interrupt:20 Memory:e8a00000-e8a20000 

- w/o ip command
eth0      Link encap:Ethernet  HWaddr 00:01:AF:30:9D:28  
          inet addr:128.224.232.234  Bcast:128.224.233.255  Mask:255.255.254.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:75036 errors:0 dropped:18764 overruns:0 frame:0
          TX packets:536 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:6936329 (6.6 MiB)  TX bytes:127107 (124.1 KiB)
          Interrupt:20 Memory:e8a00000-e8a20000 


I checked the "50default" shell and found that broadcast address is not fed in case ip command or ifconfig neither when invoking "udhcpc" command.
Always nothing to be contained in BROADCAST although this shell seems to expect..

/etc/udhcp.d/50default
L8
[ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
[ -n "$subnet" ] && NETMASK="netmask $subnet"

In case of ifconfig, it doesn't care of it's existence because it will automatically calculate broadcast address then assign it if there is no broadcast option.
However in case of ip command, it requires broadcast address statically.

L38
                if [ $have_bin_ip -eq 1 ]; then
                        ip addr add dev $interface local $ip/$mask $BROADCAST
                else
                        /sbin/ifconfig $interface $ip $BROADCAST $NETMASK
                fi

This seems an issue in busybox package.
Please address to get broadcast address when ip command is enabled.

Steps to Reproduce

1. Create a project.
Here is my configuration.
$ configure --enable-board=intel-xeon-core --enable-build=profiling --enable-kernel=standard --enable-rootfs=glibc-small+initramfs-integrated --enable-target-installer=yes --enable-jobs=4 --enable-parallel-pkgbuilds=4 --enable-reconfig --with-rcpl-version=0016

2. Execute busybox menuconfig to enable "udhcpc" and "ip".
$ make -C build busybox.menuconfig

Networking Utilities  --->
[*]ip
[*] udhcp client (udhcpc) 

3. Build the target system.
$ make fs

4. Start the target system to ensure that network address is assigned through dhcp.

5. Check the assigned network address by using ifconfig etc..
$ ifconfig eth0

eth0      Link encap:Ethernet  HWaddr 00:01:AF:30:9D:28  
          inet addr:128.224.232.234  Bcast:0.0.0.0  Mask:255.255.254.0 <===(*1)
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:74582 errors:0 dropped:18682 overruns:0 frame:0
          TX packets:531 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:6893150 (6.5 MiB)  TX bytes:125727 (122.7 KiB)
          Interrupt:20 Memory:e8a00000-e8a20000 

(*1) "Bcast" field results "0.0.0.0" i.e. broadcast address is not assigned.

Other Downloads


Live chat
Online