summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorNiels Provos <provos@cvs.openbsd.org>2000-12-13 21:58:12 +0000
committerNiels Provos <provos@cvs.openbsd.org>2000-12-13 21:58:12 +0000
commite1fb51f890f7a20a5c50c62b497cd8b2a45fddad (patch)
treeef57877abfc4135f06cfb2844452306a9b88d9b0 /sys
parent91291c773bdbfeac1d0a27743e75f396f4356d4a (diff)
have add set locks, too. okay itojun@
Diffstat (limited to 'sys')
-rw-r--r--sys/net/rtsock.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c
index f4bcf7c68bd..06ed7be19a4 100644
--- a/sys/net/rtsock.c
+++ b/sys/net/rtsock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtsock.c,v 1.11 2000/03/12 01:27:11 itojun Exp $ */
+/* $OpenBSD: rtsock.c,v 1.12 2000/12/13 21:58:11 provos Exp $ */
/* $NetBSD: rtsock.c,v 1.18 1996/03/29 00:32:10 cgd Exp $ */
/*
@@ -247,6 +247,15 @@ route_output(m, va_alist)
senderr(EACCES);
switch (rtm->rtm_type) {
+ case RTM_DELETE:
+ error = rtrequest(RTM_DELETE, dst, gate, netmask,
+ rtm->rtm_flags, &saved_nrt);
+ if (error == 0) {
+ (rt = saved_nrt)->rt_refcnt++;
+ goto report;
+ }
+ break;
+
case RTM_ADD:
if (gate == 0)
senderr(EINVAL);
@@ -258,17 +267,7 @@ route_output(m, va_alist)
saved_nrt->rt_refcnt--;
saved_nrt->rt_genmask = genmask;
}
- break;
-
- case RTM_DELETE:
- error = rtrequest(RTM_DELETE, dst, gate, netmask,
- rtm->rtm_flags, &saved_nrt);
- if (error == 0) {
- (rt = saved_nrt)->rt_refcnt++;
- goto report;
- }
- break;
-
+ /* FALLTHROUGH */
case RTM_GET:
case RTM_CHANGE:
case RTM_LOCK:
@@ -356,6 +355,7 @@ route_output(m, va_alist)
/*
* Fall into
*/
+ case RTM_ADD:
case RTM_LOCK:
rt->rt_rmx.rmx_locks &= ~(rtm->rtm_inits);
rt->rt_rmx.rmx_locks |=