Subject: kern/11629: two programs can't listen to the same multicast group
To: None <gnats-bugs@gnats.netbsd.org, itojun@netbsd.org>
From: None <salvet@ics.muni.cz>
List: netbsd-bugs
Date: 12/04/2000 03:20:19
>Number:         11629
>Category:       kern
>Synopsis:       two programs can't listen to the same multicast group
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Dec 04 03:20:01 PST 2000
>Closed-Date:
>Last-Modified:
>Originator:     Zdenek Salvet
>Release:        1.5_BETA
>Organization:
Institute of Computer Science of Masaryk University, Brno, Czech Republic
>Environment:
	
System: NetBSD horn.ics.muni.cz 1.5_BETA NetBSD 1.5_BETA (HORN_15BETA) #1: Fri Nov 10 14:38:35 MET 2000 salvet@horn.ics.muni.cz:/usr1/home/salvet/NetBSD-1.5_BETA/source/usr/src/sys/arch/i386/compile/HORN_15BETA i386


>Description:
	sys/netinet/udp_usrreq.c contains incorrect check for multicast
	address in udp4_realinput since version 1.53 (large sync with KAME)

        src4 = &src->sin_addr;
        sport = &src->sin_port;
        dst4 = &dst->sin_addr;
        dport = &dst->sin_port;

---->   if (IN_MULTICAST(src4->s_addr) ||
            in_broadcast(*dst4, m->m_pkthdr.rcvif)) {
                struct inpcb *last;
                /*
                 * Deliver a multicast or broadcast datagram to *all* sockets
                 * for which the local and remote addresses and ports match
                 * those of the incoming datagram.  This allows more than
                 * one process to receive multi/broadcasts on the same port.

	udp6_realinput() may have the same problem:

        if (IN6_IS_ADDR_MULTICAST(dst6)
         || (af == AF_INET && IN_MULTICAST(src4->s_addr))) {
                struct in6pcb *last;       ^^^^^
                /*
	
>How-To-Repeat:
>Fix:
      "IN_MULTICAST(dst4->s_addr)" , I think (could not test it yet).
>Release-Note:
>Audit-Trail:
>Unformatted: