summaryrefslogtreecommitdiff
path: root/sys/net/pfkeyv2_convert.c
diff options
context:
space:
mode:
authorJean-Jacques Bernard-Gundol <jjbg@cvs.openbsd.org>2001-07-05 16:48:05 +0000
committerJean-Jacques Bernard-Gundol <jjbg@cvs.openbsd.org>2001-07-05 16:48:05 +0000
commitd6dce2ee07499fccdf3d7d3091953680a369d015 (patch)
tree95cdc5ce180e17016b4203f5ab75a89e11d6dd94 /sys/net/pfkeyv2_convert.c
parent948fec4e04ff4b485f61f0ce7fa4a2c1d40e1704 (diff)
IPComp. angelos@ ok.
Diffstat (limited to 'sys/net/pfkeyv2_convert.c')
-rw-r--r--sys/net/pfkeyv2_convert.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/net/pfkeyv2_convert.c b/sys/net/pfkeyv2_convert.c
index 40f6eae71cc..42bacf26994 100644
--- a/sys/net/pfkeyv2_convert.c
+++ b/sys/net/pfkeyv2_convert.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfkeyv2_convert.c,v 1.4 2001/06/26 06:10:20 angelos Exp $ */
+/* $OpenBSD: pfkeyv2_convert.c,v 1.5 2001/07/05 16:48:04 jjbg Exp $ */
/*
* The author of this code is Angelos D. Keromytis (angelos@keromytis.org)
*
@@ -115,6 +115,7 @@ import_sa(struct tdb *tdb, struct sadb_sa *sadb_sa, struct ipsecinit *ii)
if (ii) {
ii->ii_encalg = sadb_sa->sadb_sa_encrypt;
ii->ii_authalg = sadb_sa->sadb_sa_auth;
+ ii->ii_compalg = sadb_sa->sadb_sa_encrypt; /* Yeurk! */
tdb->tdb_spi = sadb_sa->sadb_sa_spi;
tdb->tdb_wnd = sadb_sa->sadb_sa_replay;
@@ -155,6 +156,15 @@ export_sa(void **p, struct tdb *tdb)
if (tdb->tdb_flags & TDBF_INVALID)
sadb_sa->sadb_sa_state = SADB_SASTATE_LARVAL;
+ if (tdb->tdb_sproto == IPPROTO_IPCOMP) {
+ switch (tdb->tdb_compalgxform->type)
+ {
+ case CRYPTO_DEFLATE_COMP:
+ sadb_sa->sadb_sa_encrypt = SADB_X_CALG_DEFLATE;
+ break;
+ }
+ }
+
if (tdb->tdb_authalgxform) {
switch (tdb->tdb_authalgxform->type) {
case CRYPTO_MD5_HMAC: