| ★ wanayoo — archive 1999 http://www.kernelnotes.org/patch/21-p0515.html | Nouvelle recherche | Portail wanayoo |
|
Miquel van Smoorenburg (miquels@cistron.nl) Sun May 25 19:31:00 1997 |
[Home] [Linux 2.0] [Linux 2.1] [Information] [Software] [Distributions] [Links] |
|
In current kernels (I used 2.1.39) a route is automatically added for an interface when it goes up. If a route gets added for a pointopoint interface, its netmask is ignored and just a host route is added to the destination address. I think it should be possible to let the kernel add a route to the remote network (destination address/interface netmask).This makes sense; the netmask isn't used with the local address for a pointopoint interface, but it _is_ useful in combination with the destination address. The only time it makes sense to use the netmask in combination with the local interface address is when the local and the destination address are in the same network range - and then you could just as well use the destination address.
The current kernel code also does some other interesting things-
- when you put a pointopoint interface UP, the netmask is silently set to 255.255.255.255
- When you change the netmask on a running pointopoint interface, the IFF_POINTOPOINT flag gets silently deleted. And, a new network route gets installed..
The patch below fixes this, and introduces a new sysctl parameter: ip_use_ptp_netmask. If it is off (0) then:
- If a pointopoint interface goes up or down, just a host route is added/deleted, the interface netmask is not touched and ignored
- You can change the netmask on a pointopoint interface when it's running but it has no effect on the automatically added route nor does it delete the IFF_POINTOPOINT flag.
If ip_use_ptp_netmask is on (1), then:
- If a pointopoint interface goes up or down, a network route is added/deleted to the destination address/netmask
- You can change the netmask on a pointopoint interface when it's running and the automatic route will be adjusted accordingly.
ip_use_ptp_netmask defaults to 0. If people think it should default to 1, we could just as well delete the variable and not support the old way of doing things.