Bug 332531 - ifconfig returns invalid exit code when incorrect netmask is given
Summary: ifconfig returns invalid exit code when incorrect netmask is given
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: net-tools
Version: 4.5
Hardware: All
OS: Linux
low
low
Target Milestone: ---
: ---
Assignee: Zdenek Prikryl
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-10-15 14:16 UTC by Michal Marciniszyn
Modified: 2014-02-10 23:03 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-09-16 14:51:34 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Michal Marciniszyn 2007-10-15 14:16:04 UTC
Description of problem:
If we try to change netmask of the interface and we choose incorrect one (i.e.
255.255.252.255), ifconfig shows us warning, but exits with exit code 0.

Version-Release number of selected component (if applicable):
rhel 4.5

How reproducible:
always


Steps to Reproduce:
ifconfig eth0 ip_addres netmask 255.255.252.255
echo $?
  
Actual results:
0

Expected results:
non-zero exit code

Additional info:

Comment 1 Zdenek Prikryl 2008-09-16 14:51:34 UTC
ifcondig uses ioct() to setting netmask. If ioctl() successes, then ifconfig returns 0. In this case, ioctl() really successes, so ifconfig returns zero. In my opinion this is not a bug but a feature.

Zdenek


Note You need to log in before you can comment on or make changes to this bug.