diff options
author | 2001-05-29 01:03:00 +0000 | |
---|---|---|
committer | 2001-05-29 01:03:00 +0000 | |
commit | 9a31bc4438e2610e33ddb356301067a36bae3c2d (patch) | |
tree | fd93326e87540ee07f2c3fe744be313ea1e6b2f2 | |
parent | Set, don't OR the capabilities. (diff) | |
download | wireguard-openbsd-9a31bc4438e2610e33ddb356301067a36bae3c2d.tar.xz wireguard-openbsd-9a31bc4438e2610e33ddb356301067a36bae3c2d.zip |
Add ipsp_skipcrypto_{mark,unmark}()
-rw-r--r-- | sys/netinet/ip_ipsp.c | 28 | ||||
-rw-r--r-- | sys/netinet/ip_ipsp.h | 4 |
2 files changed, 30 insertions, 2 deletions
diff --git a/sys/netinet/ip_ipsp.c b/sys/netinet/ip_ipsp.c index 2ac5ec5b22f..857aa955834 100644 --- a/sys/netinet/ip_ipsp.c +++ b/sys/netinet/ip_ipsp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_ipsp.c,v 1.117 2001/05/27 05:16:32 angelos Exp $ */ +/* $OpenBSD: ip_ipsp.c,v 1.118 2001/05/29 01:03:00 angelos Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), @@ -1248,3 +1248,29 @@ ipsp_reffree(struct ipsec_ref *ipr) if (--ipr->ref_count <= 0) FREE(ipr, ipr->ref_malloctype); } + +/* Mark a TDB as TDBF_SKIPCRYPTO. */ +void +ipsp_skipcrypto_mark(struct tdb_ident *tdbi) +{ + struct tdb *tdb; + int s = spltdb(); + + tdb = gettdb(tdbi->spi, &tdbi->dst, tdbi->proto); + if (tdb != NULL) + tdb->tdb_flags |= TDBF_SKIPCRYPTO; + splx(s); +} + +/* Unmark a TDB as TDBF_SKIPCRYPTO. */ +void +ipsp_skipcrypto_unmark(struct tdb_ident *tdbi) +{ + struct tdb *tdb; + int s = spltdb(); + + tdb = gettdb(tdbi->spi, &tdbi->dst, tdbi->proto); + if (tdb != NULL) + tdb->tdb_flags &= ~TDBF_SKIPCRYPTO; + splx(s); +} diff --git a/sys/netinet/ip_ipsp.h b/sys/netinet/ip_ipsp.h index 42a8d903c8a..38612515d3a 100644 --- a/sys/netinet/ip_ipsp.h +++ b/sys/netinet/ip_ipsp.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_ipsp.h,v 1.91 2001/05/27 05:17:07 angelos Exp $ */ +/* $OpenBSD: ip_ipsp.h,v 1.92 2001/05/29 01:03:01 angelos Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), @@ -595,5 +595,7 @@ extern void ipsp_delete_acquire(struct ipsec_acquire *); extern void ipsp_clear_acquire(struct tdb *); extern int ipsp_is_unspecified(union sockaddr_union); extern void ipsp_reffree(struct ipsec_ref *); +extern void ipsp_skipcrypto_unmark(struct tdb_ident *); +extern void ipsp_skipcrypto_mark(struct tdb_ident *); #endif /* _KERNEL */ #endif /* _NETINET_IPSP_H_ */ |