diff options
author | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 2000-03-28 06:58:15 +0000 |
---|---|---|
committer | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 2000-03-28 06:58:15 +0000 |
commit | 2054a7c4dc3d3314da8cee458473442656483c6c (patch) | |
tree | 71d02970037963b68af3853fe49e7e9805745992 /sys | |
parent | e945f6a215370f0e7bb715edfd7a496979c39b3a (diff) |
Set the protocol family in the destination address of bypass flows.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/netinet/ip_ipsp.c | 46 |
1 files changed, 29 insertions, 17 deletions
diff --git a/sys/netinet/ip_ipsp.c b/sys/netinet/ip_ipsp.c index db5ea0581f7..f6be7e24d00 100644 --- a/sys/netinet/ip_ipsp.c +++ b/sys/netinet/ip_ipsp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_ipsp.c,v 1.80 2000/03/17 10:25:22 angelos Exp $ */ +/* $OpenBSD: ip_ipsp.c,v 1.81 2000/03/28 06:58:14 angelos Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), @@ -645,23 +645,35 @@ gettdb(u_int32_t spi, union sockaddr_union *dst, u_int8_t proto) if (spi == 0 && proto == 0) { - /* tdb_bypass; a placeholder for bypass flows, allocate on first pass */ - if (tdb_bypass == NULL) - { - s = spltdb(); - MALLOC(tdb_bypass, struct tdb *, sizeof(struct tdb), M_TDB, M_WAITOK); - tdb_count++; - splx(s); + /* + * tdb_bypass; a placeholder for bypass flows, allocate on + * first pass. + */ + if (tdb_bypass == NULL) + { + s = spltdb(); + MALLOC(tdb_bypass, struct tdb *, sizeof(struct tdb), M_TDB, + M_WAITOK); + tdb_count++; + splx(s); - bzero(tdb_bypass, sizeof(struct tdb)); - tdb_bypass->tdb_satype = SADB_X_SATYPE_BYPASS; - tdb_bypass->tdb_established = time.tv_sec; - tdb_bypass->tdb_epoch = kernfs_epoch - 1; - tdb_bypass->tdb_flags = 0; - TAILQ_INIT(&tdb_bypass->tdb_bind_in); - TAILQ_INIT(&tdb_bypass->tdb_inp); - } - return tdb_bypass; + bzero(tdb_bypass, sizeof(struct tdb)); + tdb_bypass->tdb_satype = SADB_X_SATYPE_BYPASS; + tdb_bypass->tdb_established = time.tv_sec; + tdb_bypass->tdb_epoch = kernfs_epoch - 1; + tdb_bypass->tdb_flags = 0; + +#ifdef INET + tdb_bypass->tdb_dst.sa.sa_family = AF_INET; +#elif INET6 + tdb_bypass->tdb_dst.sa.sa_family = AF_INET6; +#endif + + TAILQ_INIT(&tdb_bypass->tdb_bind_in); + TAILQ_INIT(&tdb_bypass->tdb_inp); + } + + return tdb_bypass; } if (tdbh == NULL) |