>Synopsis:      missing "struct socket;" in netinet/ip_var.h prevents compiling 
>without MROUTING option
>Category:      system
>Environment:
        System      : OpenBSD 6.1
        Details     : OpenBSD 6.1-stable (PIGEON) #5: Thu Jul 13 17:09:51 PDT 
2017
                         briggs@pigeon:/usr/obj/sys/arch/i386/compile/PIGEON

        Architecture: OpenBSD.i386
        Machine     : i386
>Description:

If the MROUTING option is not included in the kernel configuration, code such 
as ./sys/net/pfkeyv2_parsemessage.c does not compile, failing with:

cc1: warnings being treated as errors
In file included from /usr/src/sys/net/pfkeyv2_parsemessage.c:79:
/usr/src/sys/netinet/ip_var.h:223: warning: 'struct socket' declared inside 
parameter list
/usr/src/sys/netinet/ip_var.h:223: warning: its scope is only this definition 
or declaration, which is probably not what you want
/usr/src/sys/netinet/ip_var.h:254: warning: 'struct socket' declared inside 
parameter list
/usr/src/sys/netinet/ip_var.h:258: warning: 'struct socket' declared inside 
parameter list
/usr/src/sys/netinet/ip_var.h:260: warning: 'struct socket' declared inside 
parameter list
/usr/src/sys/netinet/ip_var.h:261: warning: 'struct socket' declared inside 
parameter list

 because netinet/ip_var.h, which it includes, depends on
   #ifdef MROUTING
   extern struct socket *ip_mrouter[];     /* multicast routing daemon */
   #endif
to get a declaration of struct socket outside of any parameter lists.

This was also reported 25-Jun-2014 by Ivan Solonin on the OpenBSD-misc list, 
but there was no follow-up or fix.

>How-To-Repeat:
        remove option MROUTING from kernel configuration, rebuild the kernel.
>Fix:

One possibility:

cvs server: Diffing sys/netinet
Index: sys/netinet/ip_var.h
===================================================================
RCS file: /cvs/src/sys/netinet/ip_var.h,v
retrieving revision 1.70
diff -u -p -r1.70 ip_var.h
--- sys/netinet/ip_var.h        13 Mar 2017 20:18:21 -0000      1.70
+++ sys/netinet/ip_var.h        14 Jul 2017 01:11:48 -0000
@@ -216,6 +216,7 @@ extern int la_hold_total;
 
 extern struct rttimer_queue *ip_mtudisc_timeout_q;
 extern struct pool ipqent_pool;
+struct socket;
 struct route;
 struct inpcb;
 



Reply via email to