Re: ARP: arp called for own IP address

Linus Torvalds (torvalds@cs.helsinki.fi)
Wed, 10 Apr 1996 07:10:06 +0300 (EET DST)


On 9 Apr 1996, really kuznet@ms2.inr.ac.ru wrote:
>
> Moreover, RFC1812 teaches us to check for directly attached
> interfaces BEFORE route table lookup. (One consequence of this requirement
> is that kernel should correctly route packets even if no routing
> tables created!) We might follow this recommendation,
> but it is so ugly... When remaking routing code I decided
> that this recommendation was artifact of before-CIDR epoch and
> ignored it (RFC1812 is just draft, anyway).
>
> Now all the scheme is nice and simple, routing tables are
> the only source of routing information. If someone forget to create
> route table entry for his own address, it is his fault.

Note that the RFC1812 requirement by no means requires us to complicate
the routing code: we should instead add the routes to devices
automatically when creating the devices with ifconfig. That would
actually clean up the routing code somewhat: right now the IP routing
looks at the device address as a special case, even though it would be
cleaner to have a special _entry_ for that address.

For example, the device 1.1.1.1 with netmask 255.255.255.0 should really
be thought of as two separate routes:

1.1.1.1 (255.255.255.255) - loopback
1.1.0.0 (255.255.0.0) - device

and if we did those as two separate entries it would clean some things
up. If we also sort the routing tables appropriately (ie force these
kinds of device routes first), we essentially get the rfc requirements,
with no ugly code.

Linus