NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/59561: netinet/ip_mroute.h hides struct igmpmsg under _KERNEL



>Number:         59561
>Category:       kern
>Synopsis:       netinet/ip_mroute.h hides struct igmpmsg under _KERNEL - breaks pim routers
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jul 27 19:55:00 +0000 2025
>Originator:     Frank Kardel
>Release:        NetBSD 10.1_STABLE
>Organization:
	
>Environment:
System: NetBSD gaia.acrys.com 10.1_STABLE NetBSD 10.1_STABLE (GENERIC) #0: Tue Jul 22 18:58:18 CEST 2025 kardel%gaia.acrys.com@localhost:/src/NetBSD/n10/src/obj.amd64/sys/arch/amd64/compile/GENERIC amd64
Architecture: x86_64
Machine: amd64
>Description:
	When compiling frr-10.4.0 the build fails referencing struct igmpmsg. struct igmpmsg is defined
	in netinet/ip_mroute.h under the _KERNEL guard. struct igmpmsg is documented as communication
	structure with userland. Thus hiding it under _KERNEL is not appropriate.
	Moving the definition out of the _KERNEL section allows the code to compile.

	This bug was hidden a long time in the frr suite as it falsely included a locally supplied version
	of linux/mroute.h - go figure. This was corrected after frr 9.1. and uncovered the netinet/ip_mroute.h 
	issue.
>How-To-Repeat:
	update net/frr to 10.4.0 in pkgsrc and attempt to build.
>Fix:
	Proposed patch for netinet/ip_mroute.h

--- src/sys/netinet/ip_mroute.h	2021-02-03 19:13:13.000000000 +0100
+++ BUILD.amd64/usr/include/netinet/ip_mroute.h	2025-07-27 21:04:32.103014386 +0200
@@ -267,6 +267,8 @@
 	struct	 bw_meter *mfc_bw_meter;	/* list of bandwidth meters  */
 };
 
+#endif
+
 /*
  * Structure used to communicate from kernel to multicast router.
  * (Note the convenient similarity to an IP packet.)
@@ -288,6 +290,8 @@
 __CTASSERT(sizeof(struct igmpmsg) == 20);
 #endif
 
+#ifdef _KERNEL
+
 /*
  * Argument structure used for pkt info. while upcall is made.
  */



Home | Main Index | Thread Index | Old Index