diff options
-rw-r--r-- | sys/net/if_bridge.c | 9 | ||||
-rw-r--r-- | sys/netinet/ip_icmp.c | 4 |
2 files changed, 9 insertions, 4 deletions
diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index d19f2b056b9..d026ec3731e 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bridge.c,v 1.94 2002/06/09 20:30:45 jason Exp $ */ +/* $OpenBSD: if_bridge.c,v 1.95 2002/06/10 09:13:26 itojun Exp $ */ /* * Copyright (c) 1999, 2000 Jason L. Wright (jason@thought.net) @@ -2383,14 +2383,19 @@ bridge_send_icmp_err(sc, ifp, eh, n, hassnap, llc, type, code) struct ip *ip; struct icmp *icp; struct in_addr t; - struct mbuf *m; + struct mbuf *m, *n2; int hlen; u_int8_t ether_tmp[ETHER_ADDR_LEN]; + n2 = m_copym(n, 0, M_COPYALL, M_DONTWAIT); + if (!n2) + return; m = icmp_do_error(n, type, code, 0, ifp); if (m == NULL) return; + n = n2; + ip = mtod(m, struct ip *); hlen = ip->ip_hl << 2; t = ip->ip_dst; diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c index f9625017fda..af50040940a 100644 --- a/sys/netinet/ip_icmp.c +++ b/sys/netinet/ip_icmp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_icmp.c,v 1.51 2002/06/09 16:26:10 itojun Exp $ */ +/* $OpenBSD: ip_icmp.c,v 1.52 2002/06/10 09:13:26 itojun Exp $ */ /* $NetBSD: ip_icmp.c,v 1.19 1996/02/13 23:42:22 christos Exp $ */ /* @@ -267,6 +267,7 @@ icmp_do_error(n, type, code, dest, destifp) m_tag_prepend(m, mtag); } + m_freem(n); return (m); freeit: @@ -292,7 +293,6 @@ icmp_error(n, type, code, dest, destifp) m = icmp_do_error(n, type, code, dest, destifp); if (m != NULL) icmp_reflect(m); - m_freem(n); } static struct sockaddr_in icmpsrc = { sizeof (struct sockaddr_in), AF_INET }; |