Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-1-6]: src/sys/net Pull up revision 1.61 (requested by itojun in t...
details: https://anonhg.NetBSD.org/src/rev/8f387b1c5d61
branches: netbsd-1-6
changeset: 530442:8f387b1c5d61
user: grant <grant%NetBSD.org@localhost>
date: Tue Jun 24 09:55:37 2003 +0000
description:
Pull up revision 1.61 (requested by itojun in ticket #1336):
recover code that requires exact match on rtm_change/lock (lost in
1.16). without it "route change X" would change less-specific route by
mistake. reported by jinmei@kame
diffstat:
sys/net/rtsock.c | 20 ++++++++++++++++++--
1 files changed, 18 insertions(+), 2 deletions(-)
diffs (41 lines):
diff -r 7f31ece2b129 -r 8f387b1c5d61 sys/net/rtsock.c
--- a/sys/net/rtsock.c Tue Jun 24 09:47:02 2003 +0000
+++ b/sys/net/rtsock.c Tue Jun 24 09:55:37 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rtsock.c,v 1.55 2002/02/22 17:26:31 christos Exp $ */
+/* $NetBSD: rtsock.c,v 1.55.10.1 2003/06/24 09:55:37 grant Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -65,7 +65,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.55 2002/02/22 17:26:31 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.55.10.1 2003/06/24 09:55:37 grant Exp $");
#include "opt_inet.h"
@@ -308,6 +308,22 @@
}
rt = (struct rtentry *)rn;
rt->rt_refcnt++;
+ if (rtm->rtm_type != RTM_GET) {/* XXX: too grotty */
+ struct radix_node *rn;
+ extern struct radix_node_head *mask_rnhead;
+
+ if (Bcmp(dst, rt_key(rt), dst->sa_len) != 0)
+ senderr(ESRCH);
+ if (netmask && (rn = rn_search(netmask,
+ mask_rnhead->rnh_treetop)))
+ netmask = (struct sockaddr *)rn->rn_key;
+ for (rn = rt->rt_nodes; rn; rn = rn->rn_dupedkey)
+ if (netmask == (struct sockaddr *)rn->rn_mask)
+ break;
+ if (rn == 0)
+ senderr(ETOOMANYREFS);
+ rt = (struct rtentry *)rn;
+ }
switch(rtm->rtm_type) {
Home |
Main Index |
Thread Index |
Old Index