diff options
author | 2009-11-25 07:37:29 +0000 | |
---|---|---|
committer | 2009-11-25 07:37:29 +0000 | |
commit | 3f5bb8d744ff35bfc9f41ab38bb7aca213754b2d (patch) | |
tree | 06d3370cf5134fa5f9d5a1464714835d1fc1f5da /sys | |
parent | in the resume path evaluate _WAK before dealing with device drivers (diff) | |
download | wireguard-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.c | 23 |
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; |