git: DragonFly_RELEASE_5_8 net/ip_mroute: Fix 'struct igmpmsg' for x86_64

Aaron LI aly at
Fri Dec 25 07:56:53 PST 2020

commit e34f6c2e58ca26ac09b29b0c09ea068b2d023678
Author: Uglymotha <uglymotha at>
Date:   Thu Dec 24 17:28:58 2020 +0100

    net/ip_mroute: Fix 'struct igmpmsg' for x86_64
    The `struct igmpmsg` currently uses `u_long` to define the unused fields
    instead of `uint32_t`.  This breaks the mroute API on 64 bit systems,
    because `u_long` is 64bit there.  The following code in `ip_mroute.c`
    happily corrupts kernel upcall messages on 64bit systems as the fields
    are incorrectly shifted 8bytes to the right, overwriting the destination
    ip address in the packet.
     * Send message to routing daemon to install
     * a route into the kernel table
    im = mtod(mm, struct igmpmsg *);
    im->im_msgtype = IGMPMSG_NOCACHE;
    im->im_mbz = 0;
    im->im_vif = vifi;
    Fix this issue by replacing `u_long` with `uint32_t` in `struct igmpmsg`.
    This change has also been made in FreeBSD at:
    This fix is submitted by Uglymotha at GitHub:

Summary of changes:
 sys/net/ip_mroute/ip_mroute.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

DragonFly BSD source repository

More information about the Commits mailing list