FS#20290 - [net-tools] Ifconfig is ignoring netmask

Attached to Project: Arch Linux
Opened by Rodrigo Mello Nardi (Uriel_Lajtak) - Tuesday, 27 July 2010, 12:30 GMT
Last edited by Ronald van Haren (pressh) - Monday, 12 September 2011, 07:01 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Ronald van Haren (pressh)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:
When you use the number of bits for netmask instead of IP format, the ifconfig ignores the mask passed and defines a default mask based on the class of the IP address.

i.e.:
$ sudo ifconfig eth6 190.168.1.1/8
$ ifconfig
eth6 Link encap:Ethernet HWaddr 00:E0:A0:00:93:70
inet addr:190.168.1.1 Bcast:190.168.255.255 Mask:255.255.0.0

$ sudo ifconfig eth6 10.10.10.1/24
$ ifconfig
eth6 Link encap:Ethernet HWaddr 00:E0:A0:00:93:70
inet addr:10.10.10.1 Bcast:10.255.255.255 Mask:255.0.0.0

$ sudo ifconfig eth6 192.168.1.1/10
$ ifconfig
eth6 Link encap:Ethernet HWaddr 00:E0:A0:00:93:70
inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0


Steps to reproduce:
$ sudo ifconfig eth6 10.1.1.1/24

$ ifconfig eth6
eth6 Link encap:Ethernet HWaddr 00:E0:A0:00:9C:9A
inet addr:10.1.1.1 Bcast:10.255.255.255 Mask:255.0.0.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:103348 errors:0 dropped:0 overruns:0 frame:0
TX packets:75319 errors:0 dropped:0 overruns:0 carrier:376
collisions:0 txqueuelen:1000
RX bytes:6350616 (6.0 Mb) TX bytes:4670632 (4.4 Mb)
Interrupt:19 Memory:febff400-febff4ff

$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.3.101.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
1.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 eth5
10.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 eth6
0.0.0.0 10.3.101.254 0.0.0.0 UG 0 0 0 eth0

$ sudo ifconfig eth6 10.10.10.1/24
$ ifconfig
eth6 Link encap:Ethernet HWaddr 00:E0:A0:00:93:70
inet addr:10.10.10.1 Bcast:10.255.255.255 Mask:255.0.0.0

$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.3.101.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
1.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 eth5
10.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 eth6
0.0.0.0 10.3.101.254 0.0.0.0 UG 0 0 0 eth0
This task depends upon

Closed by  Ronald van Haren (pressh)
Monday, 12 September 2011, 07:01 GMT
Reason for closing:  Fixed
Additional comments about closing:  net-tools 1.60.20110819cvs-1
Comment by Ionut Biru (wonder) - Tuesday, 27 July 2010, 13:13 GMT
everything you got there is very out of date.
Comment by Jan de Groot (JGC) - Tuesday, 27 July 2010, 17:22 GMT
Where's the use of address/netmask documented? I can't find it in the manpage and it looks like the only notation used for "/" signs is in ipv6 addresses to set the prefixlen.
Comment by Rodrigo Mello Nardi (Uriel_Lajtak) - Tuesday, 27 July 2010, 18:07 GMT
Oh... I tried in a updated Ubuntu and the issue didn't show up. Guess Ionut is right...

@ Jan
Although it's not documented for IPv4, the '/' seems to work with it too... At least in Ubuntu...
Comment by Jan de Groot (JGC) - Wednesday, 28 July 2010, 09:10 GMT
Ubuntu and Debian have a highly patched version of net-tools. Support for netmask in the address might have been added or fixed in one of their patches. Upstream doesn't look very active though.
Comment by Ronald van Haren (pressh) - Thursday, 05 August 2010, 20:38 GMT
interesting, I've been googling a bit and browsing through debian's patches [1] (at least all the ones beginning with CVS).
Seems the patches debian applies are mostly upstream already in their cvs [2]. There is also some statement that they are planning to release a 1.65 version with all debian patches included but I've no idea how old that statement is.

If I'm not mistaken the requested feature should exist in upstream cvs (can you try rodrigo?). What do we want to do here, try an update to a current cvs version, or leave it at the current really old version?

[1] http://patch-tracker.debian.org/package/net-tools/1.60-23
[2] https://developer.berlios.de/cvs/?group_id=4537

Comment by Ronald van Haren (pressh) - Monday, 22 August 2011, 07:48 GMT
Is this fixed in net-tools 1.60.20110819cvs-1 ?
Comment by Jakob Matthes (jakobm) - Sunday, 11 September 2011, 08:29 GMT
Ronald: this issue is fixed with net-tools 1.60.20110819cvs-1.
Aside, where are the upstream sources belonging to that version?
Comment by Ronald van Haren (pressh) - Monday, 12 September 2011, 07:01 GMT
Okay, I'll close it.

The source is available via:
ftp://ftp.archlinux.org/other/net-tools/net-tools-1.60.20110819cvs.tar.bz2

If you're looking for upstream CVS, follow the links at: https://developer.berlios.de/projects/net-tools/

Loading...