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/udp_usrreq.c,v rcsdiff: /ftp/cvs/cvsroot/src/sys/netinet/udp_usrreq.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.109 retrieving revision 1.112 diff -u -p -r1.109 -r1.112 --- src/sys/netinet/udp_usrreq.c 2003/09/04 09:17:03 1.109 +++ src/sys/netinet/udp_usrreq.c 2003/10/18 13:05:45 1.112 @@ -1,4 +1,4 @@ -/* $NetBSD: udp_usrreq.c,v 1.109 2003/09/04 09:17:03 itojun Exp $ */ +/* $NetBSD: udp_usrreq.c,v 1.112 2003/10/18 13:05:45 enami Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -61,7 +61,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: udp_usrreq.c,v 1.109 2003/09/04 09:17:03 itojun Exp $"); +__KERNEL_RCSID(0, "$NetBSD: udp_usrreq.c,v 1.112 2003/10/18 13:05:45 enami Exp $"); #include "opt_inet.h" #include "opt_ipsec.h" @@ -270,8 +270,8 @@ udp_input(m, va_alist) */ if (uh->uh_sum) { switch (m->m_pkthdr.csum_flags & - ((m->m_pkthdr.rcvif->if_csum_flags_rx & M_CSUM_UDPv4) | - M_CSUM_TCP_UDP_BAD | M_CSUM_DATA)) { + ((m->m_pkthdr.rcvif->if_csum_flags_rx & M_CSUM_UDPv4) | + M_CSUM_TCP_UDP_BAD | M_CSUM_DATA)) { case M_CSUM_UDPv4|M_CSUM_TCP_UDP_BAD: UDP_CSUM_COUNTER_INCR(&udp_hwcsum_bad); goto badcsum; @@ -280,8 +280,10 @@ udp_input(m, va_alist) u_int32_t hw_csum = m->m_pkthdr.csum_data; UDP_CSUM_COUNTER_INCR(&udp_hwcsum_data); if (m->m_pkthdr.csum_flags & M_CSUM_NO_PSEUDOHDR) - hw_csum = in_cksum_phdr(ip->ip_src.s_addr, ip->ip_dst.s_addr, - htonl(hw_csum + ntohs(ip->ip_len) + IPPROTO_UDP)); + hw_csum = in_cksum_phdr(ip->ip_src.s_addr, + ip->ip_dst.s_addr, + htonl(hw_csum + ntohs(ip->ip_len) + + IPPROTO_UDP)); if ((hw_csum ^ 0xffff) != 0) goto badcsum; break; @@ -500,6 +502,9 @@ udp4_sendup(m, off, src, so) /* check AH/ESP integrity. */ if (so != NULL && ipsec4_in_reject_so(m, so)) { ipsecstat.in_polvio++; + if ((n = m_copy(m, 0, M_COPYALL)) != NULL) + icmp_error(n, ICMP_UNREACH, ICMP_UNREACH_ADMIN_PROHIBIT, + 0, 0); return; } #endif /*IPSEC*/ @@ -546,6 +551,9 @@ udp6_sendup(m, off, src, so) /* check AH/ESP integrity. */ if (so != NULL && ipsec6_in_reject_so(m, so)) { ipsec6stat.in_polvio++; + if ((n = m_copy(m, 0, M_COPYALL)) != NULL) + icmp6_error(n, ICMP6_DST_UNREACH, + ICMP6_DST_UNREACH_ADMIN, 0); return; } #endif /*IPSEC*/