Print this page
9832 Original bug discovered as 9560 has friends IPv4 packets coming in as IPv6 creating chaos
Reviewed by: Robert Mustacchi <rm@joyent.com>

*** 19,29 **** * CDDL HEADER END */ /* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. ! * Copyright (c) 2015, Joyent, Inc. All rights reserved. */ /* * Copyright 2014 Nexenta Systems, Inc. All rights reserved. */ --- 19,29 ---- * CDDL HEADER END */ /* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. ! * Copyright (c) 2019, Joyent, Inc. All rights reserved. */ /* * Copyright 2014 Nexenta Systems, Inc. All rights reserved. */
*** 810,822 **** boolean_t first_frag = B_FALSE; ip6_frag_t *frag = NULL; uint8_t proto; struct udphdr *udph; uchar_t *dh; ! if (!mac_ip_hdr_length_v6(ip6h, end, &hdrlen, &proto, &frag)) ! return (ENOSPC); if (proto != IPPROTO_UDP) return (EINVAL); if (frag != NULL) { --- 810,824 ---- boolean_t first_frag = B_FALSE; ip6_frag_t *frag = NULL; uint8_t proto; struct udphdr *udph; uchar_t *dh; + int errno; ! errno = mac_ip_hdr_length_v6(ip6h, end, &hdrlen, &proto, &frag); ! if (errno != 0) ! return (errno); if (proto != IPPROTO_UDP) return (EINVAL); if (frag != NULL) {
*** 859,871 **** uint16_t hdrlen; ip6_frag_t *frag = NULL; uint8_t proto; uchar_t *hdrp; struct icmp6_hdr *icmp; ! if (!mac_ip_hdr_length_v6(ip6h, end, &hdrlen, &proto, &frag)) ! return (ENOSPC); if (proto != IPPROTO_ICMPV6) return (EINVAL); if (frag != NULL) { --- 861,875 ---- uint16_t hdrlen; ip6_frag_t *frag = NULL; uint8_t proto; uchar_t *hdrp; struct icmp6_hdr *icmp; + int errno; ! errno = mac_ip_hdr_length_v6(ip6h, end, &hdrlen, &proto, &frag); ! if (errno != 0) ! return (errno); if (proto != IPPROTO_ICMPV6) return (EINVAL); if (frag != NULL) {