diff options
author | Marco Pfatschbacher <mpf@cvs.openbsd.org> | 2009-11-25 07:37:30 +0000 |
---|---|---|
committer | Marco Pfatschbacher <mpf@cvs.openbsd.org> | 2009-11-25 07:37:30 +0000 |
commit | 1d21bc23895f9063673fcccf95f6e4e363708937 (patch) | |
tree | e8f53b826efc7dc4e58f4aadcb4aa72590b687d5 /sys/netinet6 | |
parent | 143331302a36ff62a4f7c84205fc0f972c0b3902 (diff) |
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/netinet6')
-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; |