Re: Question: Gateway address == 0

From: Horst von Brand (vonbrand@sleipnir.valparaiso.cl)
Date: Sun Apr 09 2000 - 11:29:42 EST


Olaf Titz <olaf@bigred.inka.de> said:
> > Are you sure? If zero host part is not forbidden it is legal! If algoritms
> > may fail they are wrong. It should be explicitly specified somewhere that
> > some addresses are not allowed.

> Zero host part _is_ forbidden. RFC1122, section 3.2.1.3:
>
> IP addresses are not permitted to have the value 0 or -1 for
> any of the <Host-number>, <Network-number>, or <Subnet-
> number> fields (except in the special cases listed above).
> This implies that each of these fields will be at least two
> bits long.

> This implies that a gateway address, being a regular IP address used
> by a router, may not have the value 0 for "Host-number" (the part
> after the network mask). Nothing to argue at all.

OK. Then Linux needs fixing: The message which started this thread (sorry,
I haven't got it handy) claimed that one could configure a interface with
host 0. I just did so (linux-2.2.15pre17 on i686):

   [root@sleipnir linux-2.4pre]# ifconfig dummy0 200.1.1.0
   [root@sleipnir linux-2.4pre]# ifconfig dummy0
   dummy0 Link encap:Ethernet HWaddr 00:00:00:00:00:00
             inet addr:200.1.1.0 Bcast:200.1.1.255 Mask:255.255.255.0
             UP BROADCAST RUNNING NOARP MTU:1500 Metric:1
             RX packets:0 errors:0 dropped:0 overruns:0 frame:0
             TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
             collisions:0 txqueuelen:0

Broadcast (host all ones) works too:

   [root@sleipnir linux-2.4pre]# ifconfig dummy0 200.1.1.255
   [root@sleipnir linux-2.4pre]# ifconfig dummy0
   dummy0 Link encap:Ethernet HWaddr 00:00:00:00:00:00
             inet addr:200.1.1.255 Bcast:200.1.1.255 Mask:255.255.255.0
             UP BROADCAST RUNNING NOARP MTU:1500 Metric:1
             RX packets:0 errors:0 dropped:0 overruns:0 frame:0
             TX packets:1 errors:0 dropped:0 overruns:0 carrier:0
             collisions:0 txqueuelen:0

Wouldn't know where to start to fix it, sorry. ifconfig clearly can't be
blamed, the kernel must forbid illegal configurations.

-- 
Horst von Brand                             vonbrand@sleipnir.valparaiso.cl
Casilla 9G, Viņa del Mar, Chile                               +56 32 672616

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Apr 15 2000 - 21:00:13 EST