Bug 11468

Summary: ifconfig parsing bug
Product: [Retired] Red Hat Linux Reporter: rjb
Component: net-toolsAssignee: Crutcher Dunnavant <crutcher>
Status: CLOSED NOTABUG QA Contact:
Severity: low Docs Contact:
Priority: medium    
Version: 6.1   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-05-17 13:38:49 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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.