udhcpc failure - route: SIOCADDRT: Invalid argument

Denys Vlasenko vda.linux at googlemail.com
Thu Mar 12 11:37:09 UTC 2009


On Thursday 12 March 2009 02:43:12 am Tallam, Sreenivas wrote:
> Hi All, 
>  
> I am currently using BusyBox v1.10.2
...
> Currently defined functions:
>         [, [[, addgroup, adduser, ash, awk, basename, cat, chgrp,
>         chmod, chown, chroot, cmp, cp, cut, date, dd, delgroup,
>         deluser, df, dirname, dmesg, du, echo, egrep, env, expr,
>         false, fgrep, free, getty, grep, gunzip, gzip, halt, head,
>         hostid, hostname, id, ifconfig, ifdown, ifup, init, insmod,
>         ip, ipaddr, iplink, iproute, kill, killall, linuxrc, ln,
>         logger, ls, lsmod, makedevs, md5sum, mdev, mkdir, mkfifo,
>         mknod, mkswap, mktemp, modprobe, more, mount, mv, nice,
>         nslookup, ping, ping6, pivot_root, poweroff, printf, ps,
>         pwd, reboot, reset, rm, rmdir, rmmod, route, run-parts,
                                                ^^^^^
Ok, so route applet is enabled...

> I am using udhcpc for IPv4 DHCP configuration on my system. And with
> this configuration, whenever I run "ifup eth0" it fails with the message
> "route: SIOCADDRT: Invalid argument"

This message says that "route" command fails. Not ifup or udhcpc.

> Here is the detailed output ..
>  
> # ifdown eth0
> # echo $?
> 0
> # ifup eth0
> ### adapter index 1
> ### adapter hardware addreseth0: link is up, 100 FDX
> s 00:a1:93:41:e3:b8
> udhcpc (v1.10.2) started
> ### vfork'ing and execle'ing /usr/share/udhcpc/default.script
> ### entering raw listen mode
> ### opening raw socket on ifindex 1
> ### got raw socket fd 5
> ### attached filter to raw socket fd 5
> ### bound to raw socket fd 5
> ### adding option 0x35
> ### adding option 0x3d
> ### adding option 0x3c
> ### adding option 0x39
> Sending discover...
> ### Waiting on select...
> ### Got valid DHCP packet
> ### adding option 0x35
> ### adding option 0x3d
> ### adding option 0x3c
> ### adding option 0x32
> ### adding option 0x36
> Sending select for 172.22.131.162...
> ### Waiting on select...
> ### Got valid DHCP packet
> Lease of 172.22.131.162 obtained, lease time 86400
> ### vfork'ing and execle'ing /usr/share/udhcpc/default.script
> ### entering none listen mode
> route: SIOCADDRT: Invalid argument

Obviously, /usr/share/udhcpc/default.script runs route.
We need to know, which parameters it passes to route.

Find route invocation in the script. It might look similar to this:

...
      route add default gw $i dev $interface metric $((metric++))
...

Replace it with:

      echo "Addresses"
      ip a l
      echo "Routes"
      ip r l
      echo "Running: route add default gw $i dev $interface metric $((metric++))"
      strace -o /tmp/route.log route add default gw $i dev $interface metric $((metric++))

then reproduce the bug and post the output and resulting /tmp/route.log.

For completeness, you can also send the same info from working case
when you don't have IPv6.
--
vda


More information about the busybox mailing list