summaryrefslogtreecommitdiff
path: root/sys/netinet/ip_ah.c
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2021-10-22 15:44:21 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2021-10-22 15:44:21 +0000
commit18d653f1cdbcf6ba3c1d5db8b87e6a7b19650951 (patch)
tree3f67293c02106c7e67b18afd6f3b3bd10024eee9 /sys/netinet/ip_ah.c
parent5dfb6acc7f295511a08adbe6cbbd9264571d1d87 (diff)
Make error handling in IPsec consistent. Pass errors to the callers.
OK tobhe@
Diffstat (limited to 'sys/netinet/ip_ah.c')
-rw-r--r--sys/netinet/ip_ah.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/sys/netinet/ip_ah.c b/sys/netinet/ip_ah.c
index 59c3f2e930e..a10c2a7b7ba 100644
--- a/sys/netinet/ip_ah.c
+++ b/sys/netinet/ip_ah.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_ah.c,v 1.157 2021/10/21 22:59:07 tobhe Exp $ */
+/* $OpenBSD: ip_ah.c,v 1.158 2021/10/22 15:44:20 bluhm Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr) and
@@ -1164,6 +1164,7 @@ ah_output_cb(struct tdb *tdb, struct tdb_crypto *tc, struct mbuf *m, int ilen,
{
int skip = tc->tc_skip;
caddr_t ptr = (caddr_t) (tc + 1);
+ int error;
/*
* Copy original headers (with the new protocol number) back
@@ -1175,10 +1176,8 @@ ah_output_cb(struct tdb *tdb, struct tdb_crypto *tc, struct mbuf *m, int ilen,
free(tc, M_XDATA, 0);
/* Call the IPsec input callback. */
- if (ipsp_process_done(m, tdb)) {
+ error = ipsp_process_done(m, tdb);
+ if (error)
ahstat_inc(ahs_outfail);
- return -1;
- }
-
- return 0;
+ return error;
}