summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2010-01-13 10:45:22 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2010-01-13 10:45:22 +0000
commit5a340194125d7b184ad4dd822833f84eb3dff574 (patch)
tree5861279e7098a0ef5bc5f15d12dd0d134ad9a88a
parent02c7bda329dfc05c3736c27d5e723d132fc1db43 (diff)
remove subnetsarelocal / SUBNETSARELOCAL. it's been off by default since
1996 with no way to enable but kernel config or code mods and is bound to classful adressing anyway.
-rw-r--r--sys/netinet/in.c34
1 files changed, 7 insertions, 27 deletions
diff --git a/sys/netinet/in.c b/sys/netinet/in.c
index f200d09a25e..16554aa1fb2 100644
--- a/sys/netinet/in.c
+++ b/sys/netinet/in.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: in.c,v 1.59 2010/01/13 10:30:31 henning Exp $ */
+/* $OpenBSD: in.c,v 1.60 2010/01/13 10:45:21 henning Exp $ */
/* $NetBSD: in.c,v 1.26 1996/02/13 23:41:39 christos Exp $ */
/*
@@ -95,38 +95,18 @@ int in_lifaddr_ioctl(struct socket *, u_long, caddr_t,
int in_addprefix(struct in_ifaddr *, int);
int in_scrubprefix(struct in_ifaddr *);
-#ifndef SUBNETSARELOCAL
-#define SUBNETSARELOCAL 0
-#endif
-
-int subnetsarelocal = SUBNETSARELOCAL;
-
-/*
- * Return 1 if an internet address is for a ``local'' host
- * (one to which we have a connection). If subnetsarelocal
- * is true, this includes other subnets of the local net.
- * Otherwise, it includes only the directly-connected (sub)nets.
- */
+/* Return 1 if an internet address is for a directly connected host */
int
in_localaddr(struct in_addr in, u_int rdomain)
{
struct in_ifaddr *ia;
rdomain = rtable_l2(rdomain);
- if (subnetsarelocal) {
- TAILQ_FOREACH(ia, &in_ifaddr, ia_list) {
- if (ia->ia_ifp->if_rdomain != rdomain)
- continue;
- if ((in.s_addr & ia->ia_netmask) == ia->ia_net)
- return (1);
- }
- } else {
- TAILQ_FOREACH(ia, &in_ifaddr, ia_list) {
- if (ia->ia_ifp->if_rdomain != rdomain)
- continue;
- if ((in.s_addr & ia->ia_netmask) == ia->ia_net)
- return (1);
- }
+ TAILQ_FOREACH(ia, &in_ifaddr, ia_list) {
+ if (ia->ia_ifp->if_rdomain != rdomain)
+ continue;
+ if ((in.s_addr & ia->ia_netmask) == ia->ia_net)
+ return (1);
}
return (0);
}