Bug 11468 - ifconfig parsing bug
Summary: ifconfig parsing bug
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: net-tools
Version: 6.1
Hardware: All
OS: Linux
medium
low
Target Milestone: ---
Assignee: Crutcher Dunnavant
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-05-17 13:38 UTC by rjb
Modified: 2008-05-01 15:37 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2000-05-17 13:38:49 UTC
Embargoed:


Attachments (Terms of Use)

Description rjb 2000-05-17 13:38:49 UTC
ifconfig doesnt parse its arguments properly and generate a syntax error
in the case that more than one address is specified.  For example:

ifconfig eth0 192.168.1.1 192.168.2.2 192.168.3.3 192.168.4.4 192.168.5.5

will generate five calls to ioctl(SIOCSIFADDR).  One for each with the
final address being set.  Now imagine if someone types

ifconfig eth0 192.168.1.1 mask 255.255.240.0

instead of

ifconfig eth0 192.168.1.1 netmask 255.255.240.0

and further suppose that that user is unlucky enough to have a machine
called "mask" on their network.  Then the final address set of
255.255.240.0 will fail (it is an invalid address) and the machine will be
left with its IP address being the same as that of machine "mask".

This is bad.  ifconfig should check its arguments properly and fail with
a usage message if too many are specified.


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