udp6_usrreq.c (235959) | udp6_usrreq.c (236170) |
---|---|
1/*- 2 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 3 * Copyright (c) 2010-2011 Juniper Networks, Inc. 4 * All rights reserved. 5 * 6 * Portions of this software were developed by Robert N. M. Watson under 7 * contract to Juniper Networks, Inc. 8 * --- 53 unchanged lines hidden (view full) --- 62 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 63 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 64 * SUCH DAMAGE. 65 * 66 * @(#)udp_usrreq.c 8.6 (Berkeley) 5/23/95 67 */ 68 69#include <sys/cdefs.h> | 1/*- 2 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 3 * Copyright (c) 2010-2011 Juniper Networks, Inc. 4 * All rights reserved. 5 * 6 * Portions of this software were developed by Robert N. M. Watson under 7 * contract to Juniper Networks, Inc. 8 * --- 53 unchanged lines hidden (view full) --- 62 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 63 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 64 * SUCH DAMAGE. 65 * 66 * @(#)udp_usrreq.c 8.6 (Berkeley) 5/23/95 67 */ 68 69#include <sys/cdefs.h> |
70__FBSDID("$FreeBSD: head/sys/netinet6/udp6_usrreq.c 235959 2012-05-25 02:19:17Z bz $"); | 70__FBSDID("$FreeBSD: head/sys/netinet6/udp6_usrreq.c 236170 2012-05-28 09:30:13Z bz $"); |
71 72#include "opt_inet.h" 73#include "opt_inet6.h" 74#include "opt_ipfw.h" 75#include "opt_ipsec.h" 76 77#include <sys/param.h> 78#include <sys/jail.h> --- 146 unchanged lines hidden (view full) --- 225 /* 226 * Checksum extended UDP header and data. 227 */ 228 if (uh->uh_sum == 0) { 229 UDPSTAT_INC(udps_nosum); 230 goto badunlocked; 231 } 232 | 71 72#include "opt_inet.h" 73#include "opt_inet6.h" 74#include "opt_ipfw.h" 75#include "opt_ipsec.h" 76 77#include <sys/param.h> 78#include <sys/jail.h> --- 146 unchanged lines hidden (view full) --- 225 /* 226 * Checksum extended UDP header and data. 227 */ 228 if (uh->uh_sum == 0) { 229 UDPSTAT_INC(udps_nosum); 230 goto badunlocked; 231 } 232 |
233 if (m->m_pkthdr.csum_flags & CSUM_DATA_VALID) { | 233 if (m->m_pkthdr.csum_flags & CSUM_DATA_VALID_IPV6) { |
234 if (m->m_pkthdr.csum_flags & CSUM_PSEUDO_HDR) 235 uh_sum = m->m_pkthdr.csum_data; 236 else 237 uh_sum = in6_cksum_pseudo(ip6, ulen, 238 IPPROTO_UDP, m->m_pkthdr.csum_data); 239 uh_sum ^= 0xffff; 240 } else 241 uh_sum = in6_cksum(m, IPPROTO_UDP, off, ulen); --- 537 unchanged lines hidden (view full) --- 779 ip6->ip6_plen = htons((u_short)plen); 780#endif 781 ip6->ip6_nxt = IPPROTO_UDP; 782 ip6->ip6_hlim = in6_selecthlim(inp, NULL); 783 ip6->ip6_src = *laddr; 784 ip6->ip6_dst = *faddr; 785 786 udp6->uh_sum = in6_cksum_pseudo(ip6, plen, IPPROTO_UDP, 0); | 234 if (m->m_pkthdr.csum_flags & CSUM_PSEUDO_HDR) 235 uh_sum = m->m_pkthdr.csum_data; 236 else 237 uh_sum = in6_cksum_pseudo(ip6, ulen, 238 IPPROTO_UDP, m->m_pkthdr.csum_data); 239 uh_sum ^= 0xffff; 240 } else 241 uh_sum = in6_cksum(m, IPPROTO_UDP, off, ulen); --- 537 unchanged lines hidden (view full) --- 779 ip6->ip6_plen = htons((u_short)plen); 780#endif 781 ip6->ip6_nxt = IPPROTO_UDP; 782 ip6->ip6_hlim = in6_selecthlim(inp, NULL); 783 ip6->ip6_src = *laddr; 784 ip6->ip6_dst = *faddr; 785 786 udp6->uh_sum = in6_cksum_pseudo(ip6, plen, IPPROTO_UDP, 0); |
787 m->m_pkthdr.csum_flags = CSUM_UDP; | 787 m->m_pkthdr.csum_flags = CSUM_UDP_IPV6; |
788 m->m_pkthdr.csum_data = offsetof(struct udphdr, uh_sum); 789 790 flags = 0; 791 792 UDPSTAT_INC(udps_opackets); 793 error = ip6_output(m, optp, NULL, flags, inp->in6p_moptions, 794 NULL, inp); 795 break; --- 370 unchanged lines hidden --- | 788 m->m_pkthdr.csum_data = offsetof(struct udphdr, uh_sum); 789 790 flags = 0; 791 792 UDPSTAT_INC(udps_opackets); 793 error = ip6_output(m, optp, NULL, flags, inp->in6p_moptions, 794 NULL, inp); 795 break; --- 370 unchanged lines hidden --- |