ip_icmp.c (149378) | ip_icmp.c (151967) |
---|---|
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 --- 13 unchanged lines hidden (view full) --- 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * @(#)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 --- 13 unchanged lines hidden (view full) --- 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * @(#)ip_icmp.c 8.2 (Berkeley) 1/4/94 |
30 * $FreeBSD: head/sys/netinet/ip_icmp.c 149378 2005-08-22 22:13:41Z andre $ | 30 * $FreeBSD: head/sys/netinet/ip_icmp.c 151967 2005-11-02 13:46:32Z andre $ |
31 */ 32 33#include "opt_ipsec.h" 34#include "opt_mac.h" 35 36#include <sys/param.h> 37#include <sys/systm.h> 38#include <sys/mac.h> --- 139 unchanged lines hidden (view full) --- 178 goto freeit; 179 } 180 /* Don't send error in response to a multicast or broadcast packet */ 181 if (n->m_flags & (M_BCAST|M_MCAST)) 182 goto freeit; 183 /* 184 * First, formulate icmp message 185 */ | 31 */ 32 33#include "opt_ipsec.h" 34#include "opt_mac.h" 35 36#include <sys/param.h> 37#include <sys/systm.h> 38#include <sys/mac.h> --- 139 unchanged lines hidden (view full) --- 178 goto freeit; 179 } 180 /* Don't send error in response to a multicast or broadcast packet */ 181 if (n->m_flags & (M_BCAST|M_MCAST)) 182 goto freeit; 183 /* 184 * First, formulate icmp message 185 */ |
186 MGETHDR(m, M_DONTWAIT, MT_HEADER); | 186 MGETHDR(m, M_DONTWAIT, MT_DATA); |
187 if (m == NULL) 188 goto freeit; 189#ifdef MAC 190 mac_create_mbuf_netlayer(n, m); 191#endif 192 /* 193 * Calculate length to quote from original packet and 194 * prevent the ICMP mbuf from overflowing. --- 519 unchanged lines hidden (view full) --- 714 u_int len; 715 716 /* 717 * Retrieve any source routing from the incoming packet; 718 * add on any record-route or timestamp options. 719 */ 720 cp = (u_char *) (ip + 1); 721 if ((opts = ip_srcroute(m)) == 0 && | 187 if (m == NULL) 188 goto freeit; 189#ifdef MAC 190 mac_create_mbuf_netlayer(n, m); 191#endif 192 /* 193 * Calculate length to quote from original packet and 194 * prevent the ICMP mbuf from overflowing. --- 519 unchanged lines hidden (view full) --- 714 u_int len; 715 716 /* 717 * Retrieve any source routing from the incoming packet; 718 * add on any record-route or timestamp options. 719 */ 720 cp = (u_char *) (ip + 1); 721 if ((opts = ip_srcroute(m)) == 0 && |
722 (opts = m_gethdr(M_DONTWAIT, MT_HEADER))) { | 722 (opts = m_gethdr(M_DONTWAIT, MT_DATA))) { |
723 opts->m_len = sizeof(struct in_addr); 724 mtod(opts, struct in_addr *)->s_addr = 0; 725 } 726 if (opts) { 727#ifdef ICMPPRINTFS 728 if (icmpprintfs) 729 printf("icmp_reflect optlen %d rt %d => ", 730 optlen, opts->m_len); --- 200 unchanged lines hidden --- | 723 opts->m_len = sizeof(struct in_addr); 724 mtod(opts, struct in_addr *)->s_addr = 0; 725 } 726 if (opts) { 727#ifdef ICMPPRINTFS 728 if (icmpprintfs) 729 printf("icmp_reflect optlen %d rt %d => ", 730 optlen, opts->m_len); --- 200 unchanged lines hidden --- |