Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/net Fix previous
details: https://anonhg.NetBSD.org/src/rev/46540068fd65
branches: trunk
changeset: 337795:46540068fd65
user: ozaki-r <ozaki-r%NetBSD.org@localhost>
date: Tue Apr 28 02:56:58 2015 +0000
description:
Fix previous
sockaddr_copy never fail here so we can just return in success.
The previous code worked anyway, so I didn't notice the mistake...
diffstat:
sys/net/route.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diffs (34 lines):
diff -r 9b2dd4bf79a4 -r 46540068fd65 sys/net/route.c
--- a/sys/net/route.c Tue Apr 28 02:38:53 2015 +0000
+++ b/sys/net/route.c Tue Apr 28 02:56:58 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: route.c,v 1.142 2015/04/07 04:36:19 ozaki-r Exp $ */
+/* $NetBSD: route.c,v 1.143 2015/04/28 02:56:58 ozaki-r Exp $ */
/*-
* Copyright (c) 1998, 2008 The NetBSD Foundation, Inc.
@@ -94,7 +94,7 @@
#include "opt_route.h"
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: route.c,v 1.142 2015/04/07 04:36:19 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: route.c,v 1.143 2015/04/28 02:56:58 ozaki-r Exp $");
#include <sys/param.h>
#ifdef RTFLUSH_DEBUG
@@ -1472,11 +1472,11 @@
if (ro->ro_sa->sa_family == sa->sa_family) {
rtcache_clear(ro);
sockaddr_copy(ro->ro_sa, ro->ro_sa->sa_len, sa);
- sockaddr_free(ro->ro_sa);
- } else {
- /* free ro_sa, wrong family */
- rtcache_free(ro);
+ rtcache_invariants(ro);
+ return 0;
}
+ /* free ro_sa, wrong family */
+ rtcache_free(ro);
}
KASSERT(ro->_ro_rt == NULL);
Home |
Main Index |
Thread Index |
Old Index