ip_icmp.c (108461) | ip_icmp.c (109623) |
---|---|
1/* 2 * Copyright (c) 1982, 1986, 1988, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)ip_icmp.c 8.2 (Berkeley) 1/4/94 | 1/* 2 * Copyright (c) 1982, 1986, 1988, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)ip_icmp.c 8.2 (Berkeley) 1/4/94 |
34 * $FreeBSD: head/sys/netinet/ip_icmp.c 108461 2002-12-30 18:45:31Z sam $ | 34 * $FreeBSD: head/sys/netinet/ip_icmp.c 109623 2003-01-21 08:56:16Z alfred $ |
35 */ 36 37#include "opt_ipsec.h" 38#include "opt_mac.h" 39 40#include <sys/param.h> 41#include <sys/systm.h> 42#include <sys/mac.h> --- 115 unchanged lines hidden (view full) --- 158 goto freeit; 159 } 160 /* Don't send error in response to a multicast or broadcast packet */ 161 if (n->m_flags & (M_BCAST|M_MCAST)) 162 goto freeit; 163 /* 164 * First, formulate icmp message 165 */ | 35 */ 36 37#include "opt_ipsec.h" 38#include "opt_mac.h" 39 40#include <sys/param.h> 41#include <sys/systm.h> 42#include <sys/mac.h> --- 115 unchanged lines hidden (view full) --- 158 goto freeit; 159 } 160 /* Don't send error in response to a multicast or broadcast packet */ 161 if (n->m_flags & (M_BCAST|M_MCAST)) 162 goto freeit; 163 /* 164 * First, formulate icmp message 165 */ |
166 m = m_gethdr(M_DONTWAIT, MT_HEADER); | 166 m = m_gethdr(M_NOWAIT, MT_HEADER); |
167 if (m == NULL) 168 goto freeit; 169#ifdef MAC 170 mac_create_mbuf_netlayer(n, m); 171#endif 172 icmplen = min(oiplen + 8, oip->ip_len); 173 if (icmplen < sizeof(struct ip)) 174 panic("icmp_error: bad length"); --- 476 unchanged lines hidden (view full) --- 651 u_int len; 652 653 /* 654 * Retrieve any source routing from the incoming packet; 655 * add on any record-route or timestamp options. 656 */ 657 cp = (u_char *) (ip + 1); 658 if ((opts = ip_srcroute()) == 0 && | 167 if (m == NULL) 168 goto freeit; 169#ifdef MAC 170 mac_create_mbuf_netlayer(n, m); 171#endif 172 icmplen = min(oiplen + 8, oip->ip_len); 173 if (icmplen < sizeof(struct ip)) 174 panic("icmp_error: bad length"); --- 476 unchanged lines hidden (view full) --- 651 u_int len; 652 653 /* 654 * Retrieve any source routing from the incoming packet; 655 * add on any record-route or timestamp options. 656 */ 657 cp = (u_char *) (ip + 1); 658 if ((opts = ip_srcroute()) == 0 && |
659 (opts = m_gethdr(M_DONTWAIT, MT_HEADER))) { | 659 (opts = m_gethdr(M_NOWAIT, MT_HEADER))) { |
660 opts->m_len = sizeof(struct in_addr); 661 mtod(opts, struct in_addr *)->s_addr = 0; 662 } 663 if (opts) { 664#ifdef ICMPPRINTFS 665 if (icmpprintfs) 666 printf("icmp_reflect optlen %d rt %d => ", 667 optlen, opts->m_len); --- 204 unchanged lines hidden --- | 660 opts->m_len = sizeof(struct in_addr); 661 mtod(opts, struct in_addr *)->s_addr = 0; 662 } 663 if (opts) { 664#ifdef ICMPPRINTFS 665 if (icmpprintfs) 666 printf("icmp_reflect optlen %d rt %d => ", 667 optlen, opts->m_len); --- 204 unchanged lines hidden --- |