ip_icmp.c (12820) | ip_icmp.c (12881) |
---|---|
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 * $Id: ip_icmp.c,v 1.15 1995/12/08 16:46:06 wollman Exp $ | 34 * $Id: ip_icmp.c,v 1.16 1995/12/14 09:53:40 phk Exp $ |
35 */ 36 37#include <sys/param.h> 38#include <sys/systm.h> 39#include <sys/malloc.h> 40#include <sys/mbuf.h> 41#include <sys/protosw.h> 42#include <sys/socket.h> --- 146 unchanged lines hidden (view full) --- 189 register struct mbuf *m; 190 int hlen; 191{ 192 register struct icmp *icp; 193 register struct ip *ip = mtod(m, struct ip *); 194 int icmplen = ip->ip_len; 195 register int i; 196 struct in_ifaddr *ia; | 35 */ 36 37#include <sys/param.h> 38#include <sys/systm.h> 39#include <sys/malloc.h> 40#include <sys/mbuf.h> 41#include <sys/protosw.h> 42#include <sys/socket.h> --- 146 unchanged lines hidden (view full) --- 189 register struct mbuf *m; 190 int hlen; 191{ 192 register struct icmp *icp; 193 register struct ip *ip = mtod(m, struct ip *); 194 int icmplen = ip->ip_len; 195 register int i; 196 struct in_ifaddr *ia; |
197 void (*ctlfunc) __P((int, struct sockaddr *, caddr_t)); | 197 void (*ctlfunc) __P((int, struct sockaddr *, void *)); |
198 int code; 199 200 /* 201 * Locate icmp structure in mbuf, and check 202 * that not corrupted and of at least minimum length. 203 */ 204#ifdef ICMPPRINTFS 205 if (icmpprintfs) { --- 146 unchanged lines hidden (view full) --- 352 if (rt) 353 RTFREE(rt); 354 } 355 356#endif 357 ctlfunc = inetsw[ip_protox[icp->icmp_ip.ip_p]].pr_ctlinput; 358 if (ctlfunc) 359 (*ctlfunc)(code, (struct sockaddr *)&icmpsrc, | 198 int code; 199 200 /* 201 * Locate icmp structure in mbuf, and check 202 * that not corrupted and of at least minimum length. 203 */ 204#ifdef ICMPPRINTFS 205 if (icmpprintfs) { --- 146 unchanged lines hidden (view full) --- 352 if (rt) 353 RTFREE(rt); 354 } 355 356#endif 357 ctlfunc = inetsw[ip_protox[icp->icmp_ip.ip_p]].pr_ctlinput; 358 if (ctlfunc) 359 (*ctlfunc)(code, (struct sockaddr *)&icmpsrc, |
360 (caddr_t)&icp->icmp_ip); | 360 (void *)&icp->icmp_ip); |
361 break; 362 363 badcode: 364 icmpstat.icps_badcode++; 365 break; 366 367 case ICMP_ECHO: 368 icp->icmp_type = ICMP_ECHOREPLY; --- 313 unchanged lines hidden --- | 361 break; 362 363 badcode: 364 icmpstat.icps_badcode++; 365 break; 366 367 case ICMP_ECHO: 368 icp->icmp_type = ICMP_ECHOREPLY; --- 313 unchanged lines hidden --- |