Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Feb 2001 03:32:52 +0900 (JST)
From:      daisu-mi@is.aist-nara.ac.jp
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   kern/25117: ICMP Destination Port Unreachable Error Message is wrong.
Message-ID:  <200102151832.DAA12798@iplab.aist-nara.ac.jp>

next in thread | raw e-mail | index | archive | help

>Number:         25117
>Category:       kern
>Synopsis:       ICMP Destination Port Unreachable Error Message is wrong.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Feb 15 10:30:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Daisuke Miyamoto
>Release:        FreeBSD 4.2-RELEASE i386
>Organization:
Computer Language Labo / Nara Institute of Science and Technology
>Environment:

 Pentium2 300MHz and 15GB HDD and 128MB RAM. (any environments)

>Description:

 ICMP Destination Port Unreachable Error Message was wrong. This ICMP
Datagram does NOT contain the checksum value of the original UDP datagram.
It is ocurred filled in original UDP datagram by 0 when calculate UDP
checksum. Does it agree with RFC ? Does it only help NMAP to detect OS ?

>How-To-Repeat:

 Anytime.
 
>Fix:
--- sys/netinet/udp_usrreq.c.orig    Thu Nov  2 02:08:50 2000
+++ sys/netinet/udp_usrreq.c    Wed Jan 17 00:20:25 2001
@@ -162,6 +162,8 @@
        struct ip save_ip;
        struct sockaddr *append_sa;
 
+       u_short osum;
+
        udpstat.udps_ipackets++;
 
        /*
@@ -214,6 +216,7 @@
        /*
         * Checksum extended UDP header and data.
         */
+       osum = uh->uh_sum;
        if (uh->uh_sum) {
                if (m->m_pkthdr.csum_flags & CSUM_DATA_VALID) {
                        if (m->m_pkthdr.csum_flags & CSUM_PSEUDO_HDR)
@@ -234,6 +237,9 @@
                        return;
                }
        }
+
+       /* restore original datagram */
+       uh->uh_sum = osum;
 
        if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) ||
            in_broadcast(ip->ip_dst, m->m_pkthdr.rcvif)) {


>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200102151832.DAA12798>