BusyBox Bug and Patch Tracking
BusyBox
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000752 [BusyBox] Other minor always 02-21-06 01:37 11-28-06 16:23
Reporter schweikhardt View Status public  
Assigned To BusyBox
Priority normal Resolution fixed  
Status closed   Product Version 1.00
Summary 0000752: ifconfig error reporting missing; bogus exit status
Description The ifconfig utility silently ignores certain erroneous invocations.
On the other hand, it reports certain successful invocations with a non-zero exit status. This makes ifconfig pretty much unsusable in shell scripts using "set -e" as well as Makefiles.

How to reproduce on BusyBox v1.00-rc3 (2004.10.07-07:15+0000) multi-call binary:

# ifconfig lo inet 127.0.0.1/8 <--invalid syntax
# (no error message, exit status 2)


# ifconfig lo inet 127.0.0.1
# echo $?
1 # What's wrong? Should be 0.
# ifconfig eth2 inet 10.0.0.1 netmask 0xFF000000
# echo $?
1 # What's wrong? Should be 0.
  
Could someone please review all the places where ifconfig does exit() or return from main() for consistency? Ideally 0 and 1 should be the only two exit status values ever seen, just like for many POSIX utilities. Thanks a bunch!
Additional Information
Attached Files

- Relationships

- Notes
(0001180)
schweikhardt
03-09-06 08:14

It was brought to my attention that specifying the protocol familiy with "inet"
is not supported by busybox ifconfig. If that is correct, this would explain
exit status 1 for the second and third example in my original description.
But still, there's no error message which is extremely confusing because
it misleads one to think everything went fine, when in fact the command failed.

Jens Schweikhardt
 
(0001830)
vda
11-28-06 16:22

Fixed in current svn:

./busybox ifconfig lo inet 127.0.0.1; echo $?
ifconfig: inet: Unknown host

# ./busybox ifconfig lo inet 10.0.0.1 netmask 0xFF000000
ifconfig: inet: Unknown host

# ./busybox ifconfig lo -inet 10.0.0.1 netmask 0xFF000000
ifconfig: -inet: Unknown host

Actually ifconfig does not support "inet", no mention of this in --help:

# ./busybox ifconfig --help
BusyBox v1.2.2.svn (2006-11-28 20:46:20 CET) multi-call binary

Usage: ifconfig [-a] <interface> [<address>]

configure a network interface

Options:
        [add <address>[/<prefixlen>]]
        [del <address>[/<prefixlen>]]
        [[-]broadcast [<address>]] [[-]pointopoint [<address>]]
        [netmask <address>] [dstaddr <address>]
        [outfill <NN>] [keepalive <NN>]
        [hw ether <address>] [metric <NN>] [mtu <NN>]
        [[-]trailers] [[-]arp] [[-]allmulti]
        [multicast] [[-]promisc] [txqueuelen <NN>] [[-]dynamic]
        [mem_start <NN>] [io_addr <NN>] [irq <NN>]
        [up|down] ...
 

- Issue History
Date Modified Username Field Change
02-21-06 01:37 schweikhardt New Issue
02-21-06 01:37 schweikhardt Status new => assigned
02-21-06 01:37 schweikhardt Assigned To  => BusyBox
03-09-06 08:14 schweikhardt Note Added: 0001180
11-28-06 16:22 vda Note Added: 0001830
11-28-06 16:23 vda Status assigned => closed
11-28-06 16:23 vda Resolution open => fixed
11-28-06 16:23 vda Fixed in Version  => 1.2.x


Copyright © 2000 - 2006 Mantis Group
Powered by Mantis Bugtracker