diff options
author | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 1999-02-24 22:35:24 +0000 |
---|---|---|
committer | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 1999-02-24 22:35:24 +0000 |
commit | ac584a07f76e50d29c32c02d92c215beb3185a8a (patch) | |
tree | 3be3da5bff1302aad581f1f5504beb3aba554de1 /sys | |
parent | bc6ad109752ee01f946571f9488d7335d751b7fe (diff) |
Work with pfkey instead of pfencap
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net/route.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/sys/net/route.c b/sys/net/route.c index aa773c3e321..a086f50d503 100644 --- a/sys/net/route.c +++ b/sys/net/route.c @@ -1,4 +1,4 @@ -/* $OpenBSD: route.c,v 1.11 1999/02/05 01:57:32 angelos Exp $ */ +/* $OpenBSD: route.c,v 1.12 1999/02/24 22:35:23 angelos Exp $ */ /* $NetBSD: route.c,v 1.14 1996/02/13 22:00:46 christos Exp $ */ /* @@ -70,7 +70,9 @@ didn't get a copy, you may request one from <license@ipv6.nrl.navy.mil>. #endif #ifdef IPSEC -#include <net/encap.h> +#include <netinet/ip_ipsp.h> + +extern struct ifnet enc_softc; #endif #define SA(p) ((struct sockaddr *)(p)) @@ -80,6 +82,12 @@ struct sockaddr wildcard; /* zero valued cookie for wildcard searches */ static int okaytoclone __P((u_int, int)); +static struct ifaddr * +encap_findgwifa(struct sockaddr *gw) +{ + return enc_softc.if_addrlist.tqh_first; +} + void rtable_init(table) void **table; @@ -204,14 +212,14 @@ rtalloc1(dst, report) } else rt->rt_refcnt++; } else { - if (dst->sa_family != AF_ENCAP) + if (dst->sa_family != PF_KEY) rtstat.rts_unreach++; /* * IP encapsulation does lots of lookups where we don't need nor want * the RTM_MISSes that would be generated. It causes RTM_MISS storms * sent upward breaking user-level routing queries. */ - miss: if (report && dst->sa_family != AF_ENCAP) { + miss: if (report && dst->sa_family != PF_KEY) { bzero((caddr_t)&info, sizeof(info)); info.rti_info[RTAX_DST] = dst; rt_missmsg(msgtype, &info, 0, err); @@ -375,12 +383,12 @@ ifa_ifwithroute(flags, dst, gateway) #ifdef IPSEC /* - * If the destination is a AF_ENCAP address, we'll look + * If the destination is a PF_KEY address, we'll look * for the existence of a encap interface number or address * in the options list of the gateway. By default, we'll return * encap0. */ - if (dst && (dst->sa_family == AF_ENCAP)) + if (dst && (dst->sa_family == PF_KEY)) return encap_findgwifa(gateway); #endif |