2 /* $OpenBSD: ip_ipcomp.c,v 1.1 2001/07/05 12:08:52 jjbg Exp $ */
5 * Copyright (c) 2001 Jean-Jacques Bernard-Gundol (jj@wabbitt.org)
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. The name of the author may not be used to endorse or promote products
17 * derived from this software without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
20 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
23 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
24 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 /* IP payload compression protocol (IPComp), see RFC 2393 */
33 #include "opt_inet6.h"
35 #include <sys/param.h>
36 #include <sys/systm.h>
39 #include <sys/mutex.h>
40 #include <sys/socket.h>
41 #include <sys/kernel.h>
42 #include <sys/protosw.h>
43 #include <sys/sysctl.h>
45 #include <netinet/in.h>
46 #include <netinet/in_systm.h>
47 #include <netinet/ip.h>
48 #include <netinet/ip_var.h>
49 #include <netinet/ip_encap.h>
51 #include <net/netisr.h>
54 #include <netipsec/ipsec.h>
55 #include <netipsec/xform.h>
58 #include <netinet/ip6.h>
59 #include <netinet6/ip6_var.h>
60 #include <netipsec/ipsec6.h>
63 #include <netipsec/ipcomp.h>
64 #include <netipsec/ipcomp_var.h>
66 #include <netipsec/key.h>
67 #include <netipsec/key_debug.h>
69 #include <opencrypto/cryptodev.h>
70 #include <opencrypto/deflate.h>
71 #include <opencrypto/xform.h>
73 VNET_DEFINE(int, ipcomp_enable) = 1;
74 VNET_PCPUSTAT_DEFINE(struct ipcompstat, ipcompstat);
75 VNET_PCPUSTAT_SYSINIT(ipcompstat);
78 VNET_PCPUSTAT_SYSUNINIT(ipcompstat);
81 SYSCTL_DECL(_net_inet_ipcomp);
82 SYSCTL_INT(_net_inet_ipcomp, OID_AUTO, ipcomp_enable,
83 CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ipcomp_enable), 0, "");
84 SYSCTL_VNET_PCPUSTAT(_net_inet_ipcomp, IPSECCTL_STATS, stats,
85 struct ipcompstat, ipcompstat,
86 "IPCOMP statistics (struct ipcompstat, netipsec/ipcomp_var.h");
88 static int ipcomp_input_cb(struct cryptop *crp);
89 static int ipcomp_output_cb(struct cryptop *crp);
92 * RFC 3173 p 2.2. Non-Expansion Policy:
93 * If the total size of a compressed payload and the IPComp header, as
94 * defined in section 3, is not smaller than the size of the original
95 * payload, the IP datagram MUST be sent in the original non-compressed
98 * When we use IPComp in tunnel mode, for small packets we will receive
99 * encapsulated IP-IP datagrams without any compression and without IPComp
103 ipcomp_encapcheck(union sockaddr_union *src, union sockaddr_union *dst)
105 struct secasvar *sav;
107 sav = key_allocsa_tunnel(src, dst, IPPROTO_IPCOMP);
112 if (src->sa.sa_family == AF_INET)
113 return (sizeof(struct in_addr) << 4);
115 return (sizeof(struct in6_addr) << 4);
119 ipcomp_nonexp_input(struct mbuf **mp, int *offp, int proto)
135 IPCOMPSTAT_INC(ipcomps_nopf);
137 return (IPPROTO_DONE);
140 IPCOMPSTAT_ADD(ipcomps_ibytes, (*mp)->m_pkthdr.len);
141 IPCOMPSTAT_INC(ipcomps_input);
142 netisr_dispatch(isr, *mp);
143 return (IPPROTO_DONE);
147 * ipcomp_init() is called when an CPI is being set up.
150 ipcomp_init(struct secasvar *sav, struct xformsw *xsp)
152 const struct comp_algo *tcomp;
153 struct cryptoini cric;
155 /* NB: algorithm really comes in alg_enc and not alg_comp! */
156 tcomp = comp_algorithm_lookup(sav->alg_enc);
158 DPRINTF(("%s: unsupported compression algorithm %d\n", __func__,
162 sav->alg_comp = sav->alg_enc; /* set for doing histogram */
163 sav->tdb_xform = xsp;
164 sav->tdb_compalgxform = tcomp;
166 /* Initialize crypto session */
167 bzero(&cric, sizeof (cric));
168 cric.cri_alg = sav->tdb_compalgxform->type;
170 return crypto_newsession(&sav->tdb_cryptoid, &cric, V_crypto_support);
174 * ipcomp_zeroize() used when IPCA is deleted
177 ipcomp_zeroize(struct secasvar *sav)
181 err = crypto_freesession(sav->tdb_cryptoid);
182 sav->tdb_cryptoid = 0;
187 * ipcomp_input() gets called to uncompress an input packet
190 ipcomp_input(struct mbuf *m, struct secasvar *sav, int skip, int protoff)
192 struct xform_data *xd;
193 struct cryptodesc *crdc;
195 struct ipcomp *ipcomp;
197 int hlen = IPCOMP_HLENGTH;
200 * Check that the next header of the IPComp is not IPComp again, before
201 * doing any real work. Given it is not possible to do double
202 * compression it means someone is playing tricks on us.
204 if (m->m_len < skip + hlen && (m = m_pullup(m, skip + hlen)) == NULL) {
205 IPCOMPSTAT_INC(ipcomps_hdrops); /*XXX*/
206 DPRINTF(("%s: m_pullup failed\n", __func__));
209 addr = (caddr_t) mtod(m, struct ip *) + skip;
210 ipcomp = (struct ipcomp *)addr;
211 if (ipcomp->comp_nxt == IPPROTO_IPCOMP) {
213 IPCOMPSTAT_INC(ipcomps_pdrops); /* XXX have our own stats? */
214 DPRINTF(("%s: recursive compression detected\n", __func__));
218 /* Get crypto descriptors */
219 crp = crypto_getreq(1);
222 DPRINTF(("%s: no crypto descriptors\n", __func__));
223 IPCOMPSTAT_INC(ipcomps_crypto);
226 /* Get IPsec-specific opaque pointer */
227 xd = malloc(sizeof(*xd), M_XDATA, M_NOWAIT | M_ZERO);
229 DPRINTF(("%s: cannot allocate xform_data\n", __func__));
230 IPCOMPSTAT_INC(ipcomps_crypto);
235 crdc = crp->crp_desc;
237 crdc->crd_skip = skip + hlen;
238 crdc->crd_len = m->m_pkthdr.len - (skip + hlen);
239 crdc->crd_inject = skip;
241 /* Decompression operation */
242 crdc->crd_alg = sav->tdb_compalgxform->type;
245 /* Crypto operation descriptor */
246 crp->crp_ilen = m->m_pkthdr.len - (skip + hlen);
247 crp->crp_flags = CRYPTO_F_IMBUF | CRYPTO_F_CBIFSYNC;
248 crp->crp_buf = (caddr_t) m;
249 crp->crp_callback = ipcomp_input_cb;
250 crp->crp_opaque = (caddr_t) xd;
252 /* These are passed as-is to the callback */
254 xd->protoff = protoff;
258 crp->crp_sid = xd->cryptoid = sav->tdb_cryptoid;
259 SECASVAR_UNLOCK(sav);
261 return crypto_dispatch(crp);
265 * IPComp input callback from the crypto driver.
268 ipcomp_input_cb(struct cryptop *crp)
270 char buf[IPSEC_ADDRSTRLEN];
271 struct cryptodesc *crd;
272 struct xform_data *xd;
274 struct secasvar *sav;
275 struct secasindex *saidx;
278 int hlen = IPCOMP_HLENGTH, error, clen;
284 m = (struct mbuf *) crp->crp_buf;
285 xd = (struct xform_data *) crp->crp_opaque;
288 protoff = xd->protoff;
289 cryptoid = xd->cryptoid;
290 saidx = &sav->sah->saidx;
291 IPSEC_ASSERT(saidx->dst.sa.sa_family == AF_INET ||
292 saidx->dst.sa.sa_family == AF_INET6,
293 ("unexpected protocol family %u", saidx->dst.sa.sa_family));
295 /* Check for crypto errors */
296 if (crp->crp_etype) {
297 if (crp->crp_etype == EAGAIN) {
298 /* Reset the session ID */
299 if (ipsec_updateid(sav, &crp->crp_sid, &cryptoid) != 0)
300 crypto_freesession(cryptoid);
301 xd->cryptoid = crp->crp_sid;
302 return (crypto_dispatch(crp));
304 IPCOMPSTAT_INC(ipcomps_noxform);
305 DPRINTF(("%s: crypto error %d\n", __func__, crp->crp_etype));
306 error = crp->crp_etype;
309 /* Shouldn't happen... */
311 IPCOMPSTAT_INC(ipcomps_crypto);
312 DPRINTF(("%s: null mbuf returned from crypto\n", __func__));
316 IPCOMPSTAT_INC(ipcomps_hist[sav->alg_comp]);
318 clen = crp->crp_olen; /* Length of data after processing */
320 /* Release the crypto descriptors */
321 free(xd, M_XDATA), xd = NULL;
322 crypto_freereq(crp), crp = NULL;
324 /* In case it's not done already, adjust the size of the mbuf chain */
325 m->m_pkthdr.len = clen + hlen + skip;
327 if (m->m_len < skip + hlen && (m = m_pullup(m, skip + hlen)) == NULL) {
328 IPCOMPSTAT_INC(ipcomps_hdrops); /*XXX*/
329 DPRINTF(("%s: m_pullup failed\n", __func__));
330 error = EINVAL; /*XXX*/
334 /* Keep the next protocol field */
335 addr = (caddr_t) mtod(m, struct ip *) + skip;
336 nproto = ((struct ipcomp *) addr)->comp_nxt;
338 /* Remove the IPCOMP header */
339 error = m_striphdr(m, skip, hlen);
341 IPCOMPSTAT_INC(ipcomps_hdrops);
342 DPRINTF(("%s: bad mbuf chain, IPCA %s/%08lx\n", __func__,
343 ipsec_address(&sav->sah->saidx.dst, buf, sizeof(buf)),
344 (u_long) ntohl(sav->spi)));
348 /* Restore the Next Protocol field */
349 m_copyback(m, protoff, sizeof (u_int8_t), (u_int8_t *) &nproto);
351 switch (saidx->dst.sa.sa_family) {
354 error = ipsec6_common_input_cb(m, sav, skip, protoff);
359 error = ipsec4_common_input_cb(m, sav, skip, protoff);
363 panic("%s: Unexpected address family: %d saidx=%p", __func__,
364 saidx->dst.sa.sa_family, saidx);
380 * IPComp output routine, called by ipsec[46]_perform_request()
383 ipcomp_output(struct mbuf *m, struct secpolicy *sp, struct secasvar *sav,
384 u_int idx, int skip, int protoff)
386 char buf[IPSEC_ADDRSTRLEN];
387 const struct comp_algo *ipcompx;
388 struct cryptodesc *crdc;
390 struct xform_data *xd;
391 int error, ralen, maxpacketsize;
393 IPSEC_ASSERT(sav != NULL, ("null SA"));
394 ipcompx = sav->tdb_compalgxform;
395 IPSEC_ASSERT(ipcompx != NULL, ("null compression xform"));
398 * Do not touch the packet in case our payload to compress
399 * is lower than the minimal threshold of the compression
400 * alogrithm. We will just send out the data uncompressed.
401 * See RFC 3173, 2.2. Non-Expansion Policy.
403 if (m->m_pkthdr.len <= ipcompx->minlen) {
404 IPCOMPSTAT_INC(ipcomps_threshold);
405 return ipsec_process_done(m, sp, sav, idx);
408 ralen = m->m_pkthdr.len - skip; /* Raw payload length before comp. */
409 IPCOMPSTAT_INC(ipcomps_output);
411 /* Check for maximum packet size violations. */
412 switch (sav->sah->saidx.dst.sa.sa_family) {
415 maxpacketsize = IP_MAXPACKET;
420 maxpacketsize = IPV6_MAXPACKET;
424 IPCOMPSTAT_INC(ipcomps_nopf);
425 DPRINTF(("%s: unknown/unsupported protocol family %d, "
426 "IPCA %s/%08lx\n", __func__,
427 sav->sah->saidx.dst.sa.sa_family,
428 ipsec_address(&sav->sah->saidx.dst, buf, sizeof(buf)),
429 (u_long) ntohl(sav->spi)));
430 error = EPFNOSUPPORT;
433 if (ralen + skip + IPCOMP_HLENGTH > maxpacketsize) {
434 IPCOMPSTAT_INC(ipcomps_toobig);
435 DPRINTF(("%s: packet in IPCA %s/%08lx got too big "
436 "(len %u, max len %u)\n", __func__,
437 ipsec_address(&sav->sah->saidx.dst, buf, sizeof(buf)),
438 (u_long) ntohl(sav->spi),
439 ralen + skip + IPCOMP_HLENGTH, maxpacketsize));
444 /* Update the counters */
445 IPCOMPSTAT_ADD(ipcomps_obytes, m->m_pkthdr.len - skip);
447 m = m_unshare(m, M_NOWAIT);
449 IPCOMPSTAT_INC(ipcomps_hdrops);
450 DPRINTF(("%s: cannot clone mbuf chain, IPCA %s/%08lx\n",
451 __func__, ipsec_address(&sav->sah->saidx.dst, buf,
452 sizeof(buf)), (u_long) ntohl(sav->spi)));
457 /* Ok now, we can pass to the crypto processing. */
459 /* Get crypto descriptors */
460 crp = crypto_getreq(1);
462 IPCOMPSTAT_INC(ipcomps_crypto);
463 DPRINTF(("%s: failed to acquire crypto descriptor\n",__func__));
467 crdc = crp->crp_desc;
469 /* Compression descriptor */
470 crdc->crd_skip = skip;
471 crdc->crd_len = ralen;
472 crdc->crd_flags = CRD_F_COMP;
473 crdc->crd_inject = skip;
475 /* Compression operation */
476 crdc->crd_alg = ipcompx->type;
478 /* IPsec-specific opaque crypto info */
479 xd = malloc(sizeof(struct xform_data), M_XDATA, M_NOWAIT | M_ZERO);
481 IPCOMPSTAT_INC(ipcomps_crypto);
482 DPRINTF(("%s: failed to allocate xform_data\n", __func__));
492 xd->protoff = protoff;
494 /* Crypto operation descriptor */
495 crp->crp_ilen = m->m_pkthdr.len; /* Total input length */
496 crp->crp_flags = CRYPTO_F_IMBUF | CRYPTO_F_CBIFSYNC;
497 crp->crp_buf = (caddr_t) m;
498 crp->crp_callback = ipcomp_output_cb;
499 crp->crp_opaque = (caddr_t) xd;
502 crp->crp_sid = xd->cryptoid = sav->tdb_cryptoid;
503 SECASVAR_UNLOCK(sav);
505 return crypto_dispatch(crp);
513 * IPComp output callback from the crypto driver.
516 ipcomp_output_cb(struct cryptop *crp)
518 char buf[IPSEC_ADDRSTRLEN];
519 struct xform_data *xd;
520 struct secpolicy *sp;
521 struct secasvar *sav;
525 int error, skip, protoff;
527 m = (struct mbuf *) crp->crp_buf;
528 xd = (struct xform_data *) crp->crp_opaque;
533 protoff = xd->protoff;
534 cryptoid = xd->cryptoid;
536 /* Check for crypto errors */
537 if (crp->crp_etype) {
538 if (crp->crp_etype == EAGAIN) {
539 /* Reset the session ID */
540 if (ipsec_updateid(sav, &crp->crp_sid, &cryptoid) != 0)
541 crypto_freesession(cryptoid);
542 xd->cryptoid = crp->crp_sid;
543 return (crypto_dispatch(crp));
545 IPCOMPSTAT_INC(ipcomps_noxform);
546 DPRINTF(("%s: crypto error %d\n", __func__, crp->crp_etype));
547 error = crp->crp_etype;
550 /* Shouldn't happen... */
552 IPCOMPSTAT_INC(ipcomps_crypto);
553 DPRINTF(("%s: bogus return buffer from crypto\n", __func__));
557 IPCOMPSTAT_INC(ipcomps_hist[sav->alg_comp]);
559 if (crp->crp_ilen - skip > crp->crp_olen) {
561 struct ipcomp *ipcomp;
565 /* Compression helped, inject IPCOMP header. */
566 mo = m_makespace(m, skip, IPCOMP_HLENGTH, &roff);
568 IPCOMPSTAT_INC(ipcomps_wrap);
569 DPRINTF(("%s: IPCOMP header inject failed "
570 "for IPCA %s/%08lx\n",
571 __func__, ipsec_address(&sav->sah->saidx.dst, buf,
572 sizeof(buf)), (u_long) ntohl(sav->spi)));
576 ipcomp = (struct ipcomp *)(mtod(mo, caddr_t) + roff);
578 /* Initialize the IPCOMP header */
579 /* XXX alignment always correct? */
580 switch (sav->sah->saidx.dst.sa.sa_family) {
583 ipcomp->comp_nxt = mtod(m, struct ip *)->ip_p;
588 ipcomp->comp_nxt = mtod(m, struct ip6_hdr *)->ip6_nxt;
592 ipcomp->comp_flags = 0;
593 ipcomp->comp_cpi = htons((u_int16_t) ntohl(sav->spi));
595 /* Fix Next Protocol in IPv4/IPv6 header */
596 prot = IPPROTO_IPCOMP;
597 m_copyback(m, protoff, sizeof(u_int8_t),
600 /* Adjust the length in the IP header */
601 switch (sav->sah->saidx.dst.sa.sa_family) {
604 mtod(m, struct ip *)->ip_len = htons(m->m_pkthdr.len);
609 mtod(m, struct ip6_hdr *)->ip6_plen =
610 htons(m->m_pkthdr.len) - sizeof(struct ip6_hdr);
614 IPCOMPSTAT_INC(ipcomps_nopf);
615 DPRINTF(("%s: unknown/unsupported protocol "
616 "family %d, IPCA %s/%08lx\n", __func__,
617 sav->sah->saidx.dst.sa.sa_family,
618 ipsec_address(&sav->sah->saidx.dst, buf,
619 sizeof(buf)), (u_long) ntohl(sav->spi)));
620 error = EPFNOSUPPORT;
624 /* Compression was useless, we have lost time. */
625 IPCOMPSTAT_INC(ipcomps_uncompr);
626 DPRINTF(("%s: compressions was useless %d - %d <= %d\n",
627 __func__, crp->crp_ilen, skip, crp->crp_olen));
628 /* XXX remember state to not compress the next couple
629 * of packets, RFC 3173, 2.2. Non-Expansion Policy */
632 /* Release the crypto descriptor */
636 /* NB: m is reclaimed by ipsec_process_done. */
637 error = ipsec_process_done(m, sp, sav, idx);
650 static const struct encaptab *ipe4_cookie = NULL;
651 extern struct domain inetdomain;
652 static struct protosw ipcomp4_protosw = {
654 .pr_domain = &inetdomain,
655 .pr_protocol = 0 /* IPPROTO_IPV[46] */,
656 .pr_flags = PR_ATOMIC | PR_ADDR | PR_LASTHDR,
657 .pr_input = ipcomp_nonexp_input,
658 .pr_output = rip_output,
659 .pr_ctloutput = rip_ctloutput,
660 .pr_usrreqs = &rip_usrreqs
664 ipcomp4_nonexp_encapcheck(const struct mbuf *m, int off, int proto,
667 union sockaddr_union src, dst;
670 if (V_ipcomp_enable == 0)
672 if (proto != IPPROTO_IPV4 && proto != IPPROTO_IPV6)
674 bzero(&src, sizeof(src));
675 bzero(&dst, sizeof(dst));
676 src.sa.sa_family = dst.sa.sa_family = AF_INET;
677 src.sin.sin_len = dst.sin.sin_len = sizeof(struct sockaddr_in);
678 ip = mtod(m, const struct ip *);
679 src.sin.sin_addr = ip->ip_src;
680 dst.sin.sin_addr = ip->ip_dst;
681 return (ipcomp_encapcheck(&src, &dst));
685 static const struct encaptab *ipe6_cookie = NULL;
686 extern struct domain inet6domain;
687 static struct protosw ipcomp6_protosw = {
689 .pr_domain = &inet6domain,
690 .pr_protocol = 0 /* IPPROTO_IPV[46] */,
691 .pr_flags = PR_ATOMIC | PR_ADDR | PR_LASTHDR,
692 .pr_input = ipcomp_nonexp_input,
693 .pr_output = rip6_output,
694 .pr_ctloutput = rip6_ctloutput,
695 .pr_usrreqs = &rip6_usrreqs
699 ipcomp6_nonexp_encapcheck(const struct mbuf *m, int off, int proto,
702 union sockaddr_union src, dst;
703 const struct ip6_hdr *ip6;
705 if (V_ipcomp_enable == 0)
707 if (proto != IPPROTO_IPV4 && proto != IPPROTO_IPV6)
709 bzero(&src, sizeof(src));
710 bzero(&dst, sizeof(dst));
711 src.sa.sa_family = dst.sa.sa_family = AF_INET;
712 src.sin6.sin6_len = dst.sin6.sin6_len = sizeof(struct sockaddr_in6);
713 ip6 = mtod(m, const struct ip6_hdr *);
714 src.sin6.sin6_addr = ip6->ip6_src;
715 dst.sin6.sin6_addr = ip6->ip6_dst;
716 if (IN6_IS_SCOPE_LINKLOCAL(&src.sin6.sin6_addr)) {
717 /* XXX: sa6_recoverscope() */
718 src.sin6.sin6_scope_id =
719 ntohs(src.sin6.sin6_addr.s6_addr16[1]);
720 src.sin6.sin6_addr.s6_addr16[1] = 0;
722 if (IN6_IS_SCOPE_LINKLOCAL(&dst.sin6.sin6_addr)) {
723 /* XXX: sa6_recoverscope() */
724 dst.sin6.sin6_scope_id =
725 ntohs(dst.sin6.sin6_addr.s6_addr16[1]);
726 dst.sin6.sin6_addr.s6_addr16[1] = 0;
728 return (ipcomp_encapcheck(&src, &dst));
732 static struct xformsw ipcomp_xformsw = {
733 .xf_type = XF_IPCOMP,
735 .xf_init = ipcomp_init,
736 .xf_zeroize = ipcomp_zeroize,
737 .xf_input = ipcomp_input,
738 .xf_output = ipcomp_output,
746 ipe4_cookie = encap_attach_func(AF_INET, -1,
747 ipcomp4_nonexp_encapcheck, &ipcomp4_protosw, NULL);
750 ipe6_cookie = encap_attach_func(AF_INET6, -1,
751 ipcomp6_nonexp_encapcheck, &ipcomp6_protosw, NULL);
753 xform_attach(&ipcomp_xformsw);
761 encap_detach(ipe4_cookie);
764 encap_detach(ipe6_cookie);
766 xform_detach(&ipcomp_xformsw);
769 SYSINIT(ipcomp_xform_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_MIDDLE,
770 ipcomp_attach, NULL);
771 SYSUNINIT(ipcomp_xform_uninit, SI_SUB_PROTO_DOMAIN, SI_ORDER_MIDDLE,
772 ipcomp_detach, NULL);