From 63675cfb1c78af0c144d56eebf10e405b371b9d8 Mon Sep 17 00:00:00 2001 From: Mike Belopuhov Date: Tue, 14 Apr 2015 14:20:02 +0000 Subject: make ipsp_address thread safe; ok mpi --- sys/netinet/ip_ipip.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'sys/netinet/ip_ipip.c') diff --git a/sys/netinet/ip_ipip.c b/sys/netinet/ip_ipip.c index 4128e3d3990..7f104257f66 100644 --- a/sys/netinet/ip_ipip.c +++ b/sys/netinet/ip_ipip.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_ipip.c,v 1.57 2015/04/10 13:58:20 dlg Exp $ */ +/* $OpenBSD: ip_ipip.c,v 1.58 2015/04/14 14:20:01 mikeb Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), * Angelos D. Keromytis (kermit@csd.uch.gr) and @@ -391,6 +391,9 @@ ipip_output(struct mbuf *m, struct tdb *tdb, struct mbuf **mp, int dummy, #ifdef INET6 struct ip6_hdr *ip6, *ip6o; #endif /* INET6 */ +#ifdef ENCDEBUG + char buf[INET6_ADDRSTRLEN]; +#endif /* XXX Deal with empty TDB source/destination addresses. */ @@ -405,7 +408,8 @@ ipip_output(struct mbuf *m, struct tdb *tdb, struct mbuf **mp, int dummy, DPRINTF(("ipip_output(): unspecified tunnel endpoind " "address in SA %s/%08x\n", - ipsp_address(tdb->tdb_dst), ntohl(tdb->tdb_spi))); + ipsp_address(&tdb->tdb_dst, buf, sizeof(buf)), + ntohl(tdb->tdb_spi))); ipipstat.ipips_unspec++; m_freem(m); @@ -490,7 +494,8 @@ ipip_output(struct mbuf *m, struct tdb *tdb, struct mbuf **mp, int dummy, DPRINTF(("ipip_output(): unspecified tunnel endpoind " "address in SA %s/%08x\n", - ipsp_address(tdb->tdb_dst), ntohl(tdb->tdb_spi))); + ipsp_address(&tdb->tdb_dst, buf, sizeof(buf)), + ntohl(tdb->tdb_spi))); ipipstat.ipips_unspec++; m_freem(m); -- cgit v1.2.3