Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/net correct mistake in previous
details: https://anonhg.NetBSD.org/src/rev/a218047edde7
branches: trunk
changeset: 341533:a218047edde7
user: christos <christos%NetBSD.org@localhost>
date: Tue Nov 10 18:22:46 2015 +0000
description:
correct mistake in previous
diffstat:
sys/net/if_gif.c | 22 ++++++++++------------
1 files changed, 10 insertions(+), 12 deletions(-)
diffs (82 lines):
diff -r 5302e4ae5085 -r a218047edde7 sys/net/if_gif.c
--- a/sys/net/if_gif.c Tue Nov 10 18:13:01 2015 +0000
+++ b/sys/net/if_gif.c Tue Nov 10 18:22:46 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_gif.c,v 1.89 2015/11/10 17:59:37 christos Exp $ */
+/* $NetBSD: if_gif.c,v 1.90 2015/11/10 18:22:46 christos Exp $ */
/* $KAME: if_gif.c,v 1.76 2001/08/20 02:01:02 kjc Exp $ */
/*
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.89 2015/11/10 17:59:37 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.90 2015/11/10 18:22:46 christos Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -669,8 +669,6 @@
s = splsoftnet();
- osrc = sc->gif_psrc;
- odst = sc->gif_pdst;
LIST_FOREACH(sc2, &gif_softc_list, gif_list) {
if (sc2 == sc)
continue;
@@ -706,22 +704,23 @@
#endif
}
+ osrc = sc->gif_psrc;
+ odst = sc->gif_pdst;
sc->gif_psrc = sc->gif_pdst = NULL;
-
sc->gif_si = softint_establish(SOFTINT_NET, gifintr, sc);
if (sc->gif_si == NULL) {
error = ENOMEM;
- goto bad;
+ goto rollback;
}
if ((sc->gif_psrc = sockaddr_dup(src, M_WAITOK)) == NULL) {
error = ENOMEM;
- goto bad;
+ goto rollback;
}
if ((sc->gif_pdst = sockaddr_dup(dst, M_WAITOK)) == NULL) {
error = ENOMEM;
- goto bad;
+ goto rollback;
}
switch (sc->gif_psrc->sa_family) {
@@ -740,7 +739,7 @@
break;
}
if (error)
- goto bad;
+ goto rollback;
if (osrc)
sockaddr_free(osrc);
@@ -752,15 +751,14 @@
return 0;
- bad:
- /* rollback */
+rollback:
if (sc->gif_psrc != NULL)
sockaddr_free(sc->gif_psrc);
if (sc->gif_pdst != NULL)
sockaddr_free(sc->gif_pdst);
sc->gif_psrc = osrc;
sc->gif_pdst = odst;
-
+bad:
if (sc->gif_si) {
softint_disestablish(sc->gif_si);
sc->gif_si = NULL;
Home |
Main Index |
Thread Index |
Old Index