Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 09 Sep 2024 13:39:55 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 281391] IPv6 multicast sent to wrong MAC address
Message-ID:  <bug-281391-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D281391

            Bug ID: 281391
           Summary: IPv6 multicast sent to wrong MAC address
           Product: Base System
           Version: 14.0-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: cmfitch1@gmail.com

An application that joins an IPv6 multicast group without performing an
IPV6_MULTICAST_IF setsockopt() will see packets sent to the wrong MAC addre=
ss.
According to RFC2464 section 7 [1], the MAC should be
33:33:DST[13]:DST[14]:DST[15]:DST[16], but FreeBSD is sending to
33:33:last:four:of:gateway. Setting IPV6_MULTICAST_IF results in the expect=
ed
destination MAC.

My uneducated analysis - It looks to me like this is because setting
IPV6_MULTICAST_IF bypasses (sys/netinet6/ip6_output.c:753) the routing code
that would otherwise modify the destination IP to be the gateway. I expect
what's missing is the equivalent of sys/netinet/ip_output.c:551 where the
destination is restored to be the multicast address after the routing decis=
ion
is made:

/*
 * IP destination address is multicast.  Make sure "gw"
 * still points to the address in "ro".  (It may have been
 * changed to point to a gateway address, above.)
 */
gw =3D (const struct sockaddr *)dst;

[1] https://datatracker.ietf.org/doc/html/rfc2464#section-7

--=20
You are receiving this mail because:
You are the assignee for the bug.=



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