summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authormpf <mpf@openbsd.org>2009-11-25 07:37:29 +0000
committermpf <mpf@openbsd.org>2009-11-25 07:37:29 +0000
commit3f5bb8d744ff35bfc9f41ab38bb7aca213754b2d (patch)
tree06d3370cf5134fa5f9d5a1464714835d1fc1f5da /sys
parentin the resume path evaluate _WAK before dealing with device drivers (diff)
downloadwireguard-openbsd-3f5bb8d744ff35bfc9f41ab38bb7aca213754b2d.tar.xz
wireguard-openbsd-3f5bb8d744ff35bfc9f41ab38bb7aca213754b2d.zip
Small cleanup for setsockopt IPSEC6_OUTSA:
No need to wrap input validation inside spltdb(). Simplify code by using a break instead of an else-block. OK guenther@
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet6/ip6_output.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c
index cceb8906596..3ffe2920fdf 100644
--- a/sys/netinet6/ip6_output.c
+++ b/sys/netinet6/ip6_output.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip6_output.c,v 1.109 2009/11/20 09:02:21 guenther Exp $ */
+/* $OpenBSD: ip6_output.c,v 1.110 2009/11/25 07:37:29 mpf Exp $ */
/* $KAME: ip6_output.c,v 1.172 2001/03/25 09:55:56 itojun Exp $ */
/*
@@ -1625,18 +1625,19 @@ do { \
#ifndef IPSEC
error = EINVAL;
#else
- s = spltdb();
- if (m == 0 || m->m_len != sizeof(struct tdb_ident)) {
+ if (m == NULL ||
+ m->m_len != sizeof(struct tdb_ident)) {
error = EINVAL;
- } else {
- tdbip = mtod(m, struct tdb_ident *);
- tdb = gettdb(tdbip->spi, &tdbip->dst,
- tdbip->proto);
- if (tdb == NULL)
- error = ESRCH;
- else
- tdb_add_inp(tdb, inp, 0);
+ break;
}
+ tdbip = mtod(m, struct tdb_ident *);
+ s = spltdb();
+ tdb = gettdb(tdbip->spi, &tdbip->dst,
+ tdbip->proto);
+ if (tdb == NULL)
+ error = ESRCH;
+ else
+ tdb_add_inp(tdb, inp, 0);
splx(s);
#endif
break;