Index: sys/netinet/udp_usrreq.c =================================================================== --- sys/netinet/udp_usrreq.c +++ sys/netinet/udp_usrreq.c @@ -398,7 +398,6 @@ struct inpcb *inp; uint16_t len, ip_len; struct inpcbinfo *pcbinfo; - struct ip save_ip; struct sockaddr_in udp_in[2]; struct mbuf *m; struct m_tag *fwd_tag; @@ -474,15 +473,6 @@ m_adj(m, len - ip_len); } - /* - * Save a copy of the IP header in case we want restore it for - * sending an ICMP error message in response. - */ - if (!V_udp_blackhole) - save_ip = *ip; - else - memset(&save_ip, 0, sizeof(save_ip)); - /* * Checksum extended UDP header and data. */ @@ -499,14 +489,14 @@ m->m_pkthdr.csum_data + proto)); uh_sum ^= 0xffff; } else { - char b[9]; + char b[12]; - bcopy(((struct ipovly *)ip)->ih_x1, b, 9); + bcopy(((struct ipovly *)ip)->ih_x1, b, 12); bzero(((struct ipovly *)ip)->ih_x1, 9); ((struct ipovly *)ip)->ih_len = (proto == IPPROTO_UDP) ? uh->uh_ulen : htons(ip_len); uh_sum = in_cksum(m, len + sizeof (struct ip)); - bcopy(b, ((struct ipovly *)ip)->ih_x1, 9); + bcopy(b, ((struct ipovly *)ip)->ih_x1, 12); } if (uh_sum) { UDPSTAT_INC(udps_badsum); @@ -714,7 +704,6 @@ goto badunlocked; if (badport_bandlim(BANDLIM_ICMP_UNREACH) < 0) goto badunlocked; - *ip = save_ip; icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_PORT, 0, 0); return (IPPROTO_DONE); }