Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/netinet/raw_ip.c,v retrieving revision 1.104 retrieving revision 1.105 diff -u -p -r1.104 -r1.105 --- src/sys/netinet/raw_ip.c 2008/04/07 06:31:28 1.104 +++ src/sys/netinet/raw_ip.c 2008/04/12 05:58:22 1.105 @@ -1,4 +1,4 @@ -/* $NetBSD: raw_ip.c,v 1.104 2008/04/07 06:31:28 thorpej Exp $ */ +/* $NetBSD: raw_ip.c,v 1.105 2008/04/12 05:58:22 thorpej Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -61,7 +61,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: raw_ip.c,v 1.104 2008/04/07 06:31:28 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: raw_ip.c,v 1.105 2008/04/12 05:58:22 thorpej Exp $"); #include "opt_inet.h" #include "opt_ipsec.h" @@ -86,6 +86,7 @@ __KERNEL_RCSID(0, "$NetBSD: raw_ip.c,v 1 #include #include #include +#include #include #include #include @@ -215,17 +216,21 @@ rip_input(struct mbuf *m, ...) if (last != NULL && ipsec4_in_reject_so(m, last->inp_socket)) { m_freem(m); ipsecstat.in_polvio++; - ipstat[IP_STAT_DELIVERED]--; + IP_STATDEC(IP_STAT_DELIVERED); /* do not inject data to pcb */ } else #endif /*IPSEC*/ if (last != NULL) rip_sbappendaddr(last, ip, sintosa(&ripsrc), hlen, opts, m); else if (inetsw[ip_protox[ip->ip_p]].pr_input == rip_input) { + uint64_t *ips; + icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_PROTOCOL, 0, 0); - ipstat[IP_STAT_NOPROTO]++; - ipstat[IP_STAT_DELIVERED]--; + ips = IP_STAT_GETREF(); + ips[IP_STAT_NOPROTO]++; + ips[IP_STAT_DELIVERED]--; + IP_STAT_PUTREF(); } else m_freem(m); return; @@ -363,7 +368,7 @@ rip_output(struct mbuf *m, ...) opts = NULL; /* XXX prevent ip_output from overwriting header fields */ flags |= IP_RAWOUTPUT; - ipstat[IP_STAT_RAWOUT]++; + IP_STATINC(IP_STAT_RAWOUT); } return (ip_output(m, opts, &inp->inp_route, flags, inp->inp_moptions, inp->inp_socket, &inp->inp_errormtu));