diff options
author | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 2000-12-03 19:56:21 +0000 |
---|---|---|
committer | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 2000-12-03 19:56:21 +0000 |
commit | a8d33a63221e6e5131e09fc9d5c1673dabb83b27 (patch) | |
tree | abed01a4fd433c03b9bc07757ef854bf3c5bead5 /sys/netinet/ip_output.c | |
parent | cc271649681349382b2db60ab265adecf4c749e8 (diff) |
Fix fastroute-related panic, fixes PR 1541 (cas@trans-nt.com)
Diffstat (limited to 'sys/netinet/ip_output.c')
-rw-r--r-- | sys/netinet/ip_output.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index ec7ab4151fb..9be0faaaca9 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_output.c,v 1.84 2000/11/07 18:24:26 provos Exp $ */ +/* $OpenBSD: ip_output.c,v 1.85 2000/12/03 19:56:20 angelos Exp $ */ /* $NetBSD: ip_output.c,v 1.28 1996/02/13 23:43:07 christos Exp $ */ /* @@ -559,16 +559,21 @@ sendit: error = EHOSTUNREACH; splx(s); goto done; - } else { - ip = mtod(m = m0, struct ip *); - hlen = ip->ip_hl << 2; } + if (m0 == 0) { /* in case of 'fastroute' */ + error = 0; + splx(s); + goto done; + } + ip = mtod(m = m0, struct ip *); + hlen = ip->ip_hl << 2; } #endif /* IPFILTER */ tdb = gettdb(sspi, &sdst, sproto); if (tdb == NULL) { error = EHOSTUNREACH; + splx(s); m_freem(m); goto done; } @@ -599,8 +604,12 @@ sendit: if (fr_checkp && (*fr_checkp)(ip, hlen, ifp, 1, &m0)) { error = EHOSTUNREACH; goto done; - } else - ip = mtod(m = m0, struct ip *); + } + if (m0 == 0) { /* in case of 'fastroute' */ + error = 0; + goto done; + } + ip = mtod(m = m0, struct ip *); } #endif /* |