summaryrefslogtreecommitdiffstats
path: root/sys/netipsec/ipsec_output.c
diff options
context:
space:
mode:
authorbz <bz@FreeBSD.org>2011-04-27 19:28:42 +0000
committerbz <bz@FreeBSD.org>2011-04-27 19:28:42 +0000
commitd28e675043d30fd2673b02842a810b8aec8b1696 (patch)
tree9428855084c7aa5ab9ab83364589dfafc87dbe6d /sys/netipsec/ipsec_output.c
parent09fd1db2a07e44c41a4341b1dcc53c381d095ffd (diff)
downloadFreeBSD-src-d28e675043d30fd2673b02842a810b8aec8b1696.zip
FreeBSD-src-d28e675043d30fd2673b02842a810b8aec8b1696.tar.gz
Make IPsec compile without INET adding appropriate #ifdef checks.
Unfold the IPSEC_COMMON_INPUT_CB() macro in xform_{ah,esp,ipcomp}.c to not need three different versions depending on INET, INET6 or both. Mark two places preparing for not yet supported functionality with IPv6. Reviewed by: gnn Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems MFC after: 4 days
Diffstat (limited to 'sys/netipsec/ipsec_output.c')
-rw-r--r--sys/netipsec/ipsec_output.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/sys/netipsec/ipsec_output.c b/sys/netipsec/ipsec_output.c
index 7c21d83..d10523d 100644
--- a/sys/netipsec/ipsec_output.c
+++ b/sys/netipsec/ipsec_output.c
@@ -165,7 +165,29 @@ ipsec_process_done(struct mbuf *m, struct ipsecrequest *isr)
*/
if (isr->next) {
V_ipsec4stat.ips_out_bundlesa++;
- return ipsec4_process_packet(m, isr->next, 0, 0);
+ sav = isr->next->sav;
+ saidx = &sav->sah->saidx;
+ switch (saidx->dst.sa.sa_family) {
+#ifdef INET
+ case AF_INET:
+ return ipsec4_process_packet(m, isr->next, 0, 0);
+ /* NOTREACHED */
+#endif
+#ifdef notyet
+#ifdef INET6
+ case AF_INET6:
+ /* XXX */
+ ipsec6_output_trans()
+ ipsec6_output_tunnel()
+ /* NOTREACHED */
+#endif /* INET6 */
+#endif
+ default:
+ DPRINTF(("%s: unknown protocol family %u\n", __func__,
+ saidx->dst.sa.sa_family));
+ error = ENXIO;
+ goto bad;
+ }
}
key_sa_recordxfer(sav, m); /* record data transfer */
OpenPOWER on IntegriCloud