Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/netinet in_ifscrub is no longer needed.
details: https://anonhg.NetBSD.org/src/rev/26c591c7ffd9
branches: trunk
changeset: 348001:26c591c7ffd9
user: roy <roy%NetBSD.org@localhost>
date: Thu Sep 29 15:18:18 2016 +0000
description:
in_ifscrub is no longer needed.
diffstat:
sys/netinet/in.c | 30 +++++++-----------------------
sys/netinet/in_var.h | 3 +--
2 files changed, 8 insertions(+), 25 deletions(-)
diffs (103 lines):
diff -r e8c48129e86b -r 26c591c7ffd9 sys/netinet/in.c
--- a/sys/netinet/in.c Thu Sep 29 15:10:37 2016 +0000
+++ b/sys/netinet/in.c Thu Sep 29 15:18:18 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: in.c,v 1.184 2016/09/29 15:04:17 roy Exp $ */
+/* $NetBSD: in.c,v 1.185 2016/09/29 15:18:18 roy Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -91,7 +91,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in.c,v 1.184 2016/09/29 15:04:17 roy Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in.c,v 1.185 2016/09/29 15:18:18 roy Exp $");
#include "arp.h"
@@ -608,7 +608,7 @@
break;
case SIOCSIFNETMASK:
- in_ifscrub(ifp, ia);
+ in_scrubprefix(ia);
ia->ia_sockmask = *satocsin(ifreq_getaddr(cmd, ifr));
ia->ia_subnetmask = ia->ia_sockmask.sin_addr.s_addr;
if (!newifaddr) {
@@ -624,20 +624,13 @@
case SIOCAIFADDR:
maskIsNew = 0;
if (ifra->ifra_mask.sin_len) {
- /* Only scrub if we control the prefix route,
- * otherwise userland gets a bogus message */
- if ((ia->ia_flags & IFA_ROUTE))
- in_ifscrub(ifp, ia);
+ in_scrubprefix(ia);
ia->ia_sockmask = ifra->ifra_mask;
ia->ia_subnetmask = ia->ia_sockmask.sin_addr.s_addr;
maskIsNew = 1;
}
if ((ifp->if_flags & IFF_POINTOPOINT) &&
(ifra->ifra_dstaddr.sin_family == AF_INET)) {
- /* Only scrub if we control the prefix route,
- * otherwise userland gets a bogus message */
- if ((ia->ia_flags & IFA_ROUTE))
- in_ifscrub(ifp, ia);
new_dstaddr = &ifra->ifra_dstaddr;
maskIsNew = 1; /* We lie; but the effect's the same */
} else
@@ -811,8 +804,9 @@
if (ia->ia_dad_stop != NULL)
ia->ia_dad_stop(&ia->ia_ifa);
- in_ifscrub(ia->ia_ifp, ia);
+ in_scrubprefix(ia);
in_ifremlocal(&ia->ia_ifa);
+
if (ia->ia_allhosts != NULL) {
in_delmulti(ia->ia_allhosts);
ia->ia_allhosts = NULL;
@@ -1047,16 +1041,6 @@
}
/*
- * Delete any existing route for an interface.
- */
-void
-in_ifscrub(struct ifnet *ifp, struct in_ifaddr *ia)
-{
-
- in_scrubprefix(ia);
-}
-
-/*
* Initialize an interface's internet address
* and routing table entry.
*/
@@ -1128,7 +1112,7 @@
if (hostIsNew)
in_scrubaddr(ia);
else if (scrub)
- in_ifscrub(ifp, ia);
+ in_scrubprefix(ia);
ia->ia_ifa.ifa_addr = sintosa(&ia->ia_addr);
ia->ia_ifa.ifa_dstaddr = sintosa(&ia->ia_dstaddr);
ia->ia4_flags = newflags;
diff -r e8c48129e86b -r 26c591c7ffd9 sys/netinet/in_var.h
--- a/sys/netinet/in_var.h Thu Sep 29 15:10:37 2016 +0000
+++ b/sys/netinet/in_var.h Thu Sep 29 15:18:18 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: in_var.h,v 1.86 2016/09/29 15:04:17 roy Exp $ */
+/* $NetBSD: in_var.h,v 1.87 2016/09/29 15:18:18 roy Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -413,7 +413,6 @@
void in_savemkludge(struct in_ifaddr *);
void in_restoremkludge(struct in_ifaddr *, struct ifnet *);
void in_purgemkludge(struct ifnet *);
-void in_ifscrub(struct ifnet *, struct in_ifaddr *);
void in_setmaxmtu(void);
const char *in_fmtaddr(struct in_addr);
int in_control(struct socket *, u_long, void *, struct ifnet *);
Home |
Main Index |
Thread Index |
Old Index