diff options
author | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 2001-02-28 08:24:54 +0000 |
---|---|---|
committer | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 2001-02-28 08:24:54 +0000 |
commit | a95638e7a6ee807c453ba3cb57e6c38a7ae1d55e (patch) | |
tree | 2d7f605dc2afdaeeef74add18e6d82251b97e188 /sys | |
parent | 70152b34bba0f1aaf067772e03b019efbfcfe326 (diff) |
Pretty.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/netinet/ip_spd.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/netinet/ip_spd.c b/sys/netinet/ip_spd.c index d68138b869e..4350244b4b7 100644 --- a/sys/netinet/ip_spd.c +++ b/sys/netinet/ip_spd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_spd.c,v 1.11 2001/02/28 05:27:37 angelos Exp $ */ +/* $OpenBSD: ip_spd.c,v 1.12 2001/02/28 08:24:53 angelos Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu) @@ -451,9 +451,10 @@ ipsp_spd_lookup(struct mbuf *m, int af, int hlen, int *error, int direction, } else { + ipo->ipo_last_searched = time.tv_sec; /* "touch" the entry */ + /* Find an appropriate SA from among the existing SAs */ ipo->ipo_tdb = gettdbbyaddr(&sdst, ipo->ipo_sproto, m, af); - ipo->ipo_last_searched = time.tv_sec; if (ipo->ipo_tdb) { TAILQ_INSERT_TAIL(&ipo->ipo_tdb->tdb_policy_head, ipo, @@ -1006,6 +1007,7 @@ ipsp_acquire_sa(struct ipsec_policy *ipo, union sockaddr_union *gw, m_freem(ipa->ipa_packet); ipa->ipa_packet = m_copym2(m, 0, M_COPYALL, M_DONTWAIT); } + return 0; } @@ -1014,10 +1016,13 @@ ipsp_acquire_sa(struct ipsec_policy *ipo, union sockaddr_union *gw, M_TDB, M_DONTWAIT); if (ipa == NULL) return ENOMEM; + + bzero(ipa, sizeof(struct ipsec_acquire)); bcopy(gw, &ipa->ipa_addr, sizeof(union sockaddr_union)); ipa->ipa_info.sen_len = ipa->ipa_mask.sen_len = SENT_LEN; ipa->ipa_info.sen_family = ipa->ipa_mask.sen_family = PF_KEY; + /* Just copy the right information */ switch (ipo->ipo_addr.sen_type) { |