diff options
author | guido <guido@FreeBSD.org> | 1995-06-27 17:26:27 +0000 |
---|---|---|
committer | guido <guido@FreeBSD.org> | 1995-06-27 17:26:27 +0000 |
commit | 5d28c984ccb9896069557771612be90abe5b1254 (patch) | |
tree | 4a54fbbc72f57de7d84a4f93b3c22d56e4e25b71 /sys/netinet/ip_fw.c | |
parent | 666343f7f055c064375d48bb9a608730d7145beb (diff) | |
download | FreeBSD-src-5d28c984ccb9896069557771612be90abe5b1254.zip FreeBSD-src-5d28c984ccb9896069557771612be90abe5b1254.tar.gz |
reject option in ip_fw used to panic the system. This fixes it.
-Guido
Reviewed by:
Submitted by:
Obtained from:
Diffstat (limited to 'sys/netinet/ip_fw.c')
-rw-r--r-- | sys/netinet/ip_fw.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/sys/netinet/ip_fw.c b/sys/netinet/ip_fw.c index 8e0bc5b..62a0c72 100644 --- a/sys/netinet/ip_fw.c +++ b/sys/netinet/ip_fw.c @@ -309,24 +309,15 @@ bad_packet: * packets....:) */ if (f_prt==IP_FW_F_ICMP) - return 0; + goto return_0; /* * Reply to packets rejected * by entry with this flag * set only. */ if (!(f->fw_flg&IP_FW_F_ICMPRPL)) - return 0; - m = m_get(M_DONTWAIT, MT_SOOPTS); - /* - * We never retry,we don't want to - * waste time-it is not so critical - * if ICMP unsent. - */ - if (!m) - return 0; - m->m_len = sizeof(struct ip)+64; - bcopy((caddr_t)ip,mtod(m, caddr_t),(unsigned)m->m_len); + goto return_0; + m = dtom(ip); if (f_prt==IP_FW_F_ALL) icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_HOST, 0L, 0); else @@ -337,8 +328,11 @@ bad_packet: * If global icmp flag set we will do * something here...later.. */ - return 0; + return_0; } +return_0: + m_freem(m); + return 0; good_packet: return 1; } |