diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2011-04-02 14:38:10 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2011-04-02 14:38:10 +0000 |
commit | 5da7c6fb59bf55e2a59128ff22661097db509f85 (patch) | |
tree | 8837a3ecd00d37aa539da139463d88da5feb808b | |
parent | 81f21e50877629cac5393978f7ce3ae4b52d5957 (diff) |
rmeove the link1 hack, it is in the way, it is only half-baked and doesn't
work as you think it does, and the same can easily be achieved using pf
ok claudio dlg sthen theo
-rw-r--r-- | share/man/man4/lo.4 | 39 | ||||
-rw-r--r-- | sys/netinet/ip_input.c | 7 |
2 files changed, 4 insertions, 42 deletions
diff --git a/share/man/man4/lo.4 b/share/man/man4/lo.4 index 6d4a8056b9f..efde1b8343d 100644 --- a/share/man/man4/lo.4 +++ b/share/man/man4/lo.4 @@ -1,4 +1,4 @@ -.\" $OpenBSD: lo.4,v 1.26 2007/05/31 19:19:50 jmc Exp $ +.\" $OpenBSD: lo.4,v 1.27 2011/04/02 14:38:09 henning Exp $ .\" $NetBSD: lo.4,v 1.3 1994/11/30 16:22:23 jtc Exp $ .\" .\" Copyright (c) 1983, 1991, 1993 @@ -30,7 +30,7 @@ .\" .\" @(#)lo.4 8.1 (Berkeley) 6/5/93 .\" -.Dd $Mdocdate: May 31 2007 $ +.Dd $Mdocdate: April 2 2011 $ .Dt LO 4 .Os .Sh NAME @@ -70,33 +70,6 @@ The loopback should .Em never be configured first unless no hardware interfaces exist. -.Pp -Configuring a loopback interface for -.Xr inet 4 -with the -.Em link1 -flag set will make the interface answer to the whole set of -addresses identified as being in super-net which is specified -by the address and netmask. -Obviously you should not set the -.Em link1 -flag on interface -.Nm lo0 , -but instead use another interface like -.Nm lo1 . -.Sh EXAMPLES -.Bd -literal -# ifconfig lo1 create -# ifconfig lo1 inet 192.168.1.1 netmask 255.255.255.0 link1 -.Ed -.Pp -is equivalent to: -.Bd -literal -# ifconfig lo1 create -# awk 'BEGIN {for(i=1;i<255;i++) \e - print "ifconfig lo1 inet 192.168.1."i" netmask 255.255.255.255 alias"}'| \e - sh -.Ed .Sh DIAGNOSTICS .Bl -diag .It lo%d: can't handle af%d. @@ -116,16 +89,8 @@ The .Nm device appeared in .Bx 4.2 . -.Pp -The wildcard functionality first appeared in -.Ox 2.3 . .Sh BUGS Previous versions of the system enabled the loopback interface automatically, using a non-standard Internet address (127.1). Use of that address is now discouraged; a reserved host address for the local network should be used instead. -.Pp -Care should be taken when using NAT with interfaces that have the -.Em link1 -flag set, because it may believe the packets are coming from a -loopback address. diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index 838069e54a6..af86146ed39 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_input.c,v 1.186 2011/02/11 12:16:30 bluhm Exp $ */ +/* $OpenBSD: ip_input.c,v 1.187 2011/04/02 14:38:09 henning Exp $ */ /* $NetBSD: ip_input.c,v 1.30 1996/03/16 23:53:58 christos Exp $ */ /* @@ -688,10 +688,7 @@ in_iawithaddr(struct in_addr ina, struct mbuf *m, u_int rdomain) TAILQ_FOREACH(ia, &in_ifaddr, ia_list) { if (ia->ia_ifp->if_rdomain != rdomain) continue; - if ((ina.s_addr == ia->ia_addr.sin_addr.s_addr) || - ((ia->ia_ifp->if_flags & (IFF_LOOPBACK|IFF_LINK1)) == - (IFF_LOOPBACK|IFF_LINK1) && - ia->ia_net == (ina.s_addr & ia->ia_netmask))) + if (ina.s_addr == ia->ia_addr.sin_addr.s_addr) return ia; /* check ancient classful too, e. g. for rarp-based netboot */ if (((ip_directedbcast == 0) || (m && ip_directedbcast && |