diff options
author | ru <ru@FreeBSD.org> | 2001-06-12 13:23:43 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2001-06-12 13:23:43 +0000 |
commit | e2ee5e2463262adf56309acd620a3a2d62787f25 (patch) | |
tree | 93cf0281387eb8e011e71934247341f43fa15c97 /sbin | |
parent | 93040d6fc0d3c6dcb06ba87e27e7ff7f3814a9be (diff) | |
download | FreeBSD-src-e2ee5e2463262adf56309acd620a3a2d62787f25.zip FreeBSD-src-e2ee5e2463262adf56309acd620a3a2d62787f25.tar.gz |
Fixed the -iface breakage introduced with the latest KAME merge
in revision 1.48. It is pretty valid and often feasible to use
a non-point-to-point interface as the gateway. One might, for
example, use this to route some hosts through an ARP on a local
interface, without having to assign an additional IP address:
Script started on Tue Jun 12 16:16:09 2001
# ifconfig rl0 inet
rl0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
inet 192.168.4.115 netmask 0xffffff00 broadcast 192.168.4.255
# netstat -arn -finet | grep -w rl0
192.168.4 link#1 UC 3 0 rl0 =>
192.168.4.65 0:d0:b7:16:9c:c6 UHLW 1 0 rl0 1197
# route add -net 192.168.100 -iface rl0
add net 192.168.100: gateway rl0
# ping 192.168.100.1
PING 192.168.100.1 (192.168.100.1): 56 data bytes
64 bytes from 192.168.100.1: icmp_seq=0 ttl=255 time=0.551 ms
64 bytes from 192.168.100.1: icmp_seq=1 ttl=255 time=0.268 ms
^C
--- 192.168.100.1 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max/stddev = 0.268/0.410/0.551/0.142 ms
# netstat -arn -finet | grep -w rl0
192.168.4 link#1 UC 3 0 rl0 =>
192.168.4.65 0:d0:b7:16:9c:c6 UHLW 1 0 rl0 1165
192.168.100 link#1 UCSc 1 0 rl0 =>
192.168.100.1 0:d0:b7:16:9c:c6 UHLW 1 4 rl0 1192
Script done on Tue Jun 12 16:17:12 2001
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/route/route.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/sbin/route/route.c b/sbin/route/route.c index 46d61c2..02a8dce 100644 --- a/sbin/route/route.c +++ b/sbin/route/route.c @@ -883,8 +883,7 @@ getaddr(which, s, hpp) if (ifa->ifa_addr->sa_family != AF_LINK) continue; - if (strcmp(s, ifa->ifa_name) || - (ifa->ifa_flags & IFF_POINTOPOINT) == 0) + if (strcmp(s, ifa->ifa_name)) continue; sdl = (struct sockaddr_dl *)ifa->ifa_addr; |