Current-Users archive

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

compiling new pppd w/o INET6



Hallo,

while trying to build.sh ... distribution with MKINET6=no set in /etc/mk.conf
I get a bunch of erros like the following:

/u/NetBSD/src.ks/external/bsd/ppp/usr.sbin/pppd/sys-bsd.c:208:8: error: unknown type name 'eui64_t'
  208 | static eui64_t  default_route_gateway6; /* Gateway for default IPv6 route added
      |        ^~~~~~~
/u/NetBSD/src.ks/external/bsd/ppp/usr.sbin/pppd/sys-bsd.c: In function 'sys_cleanup':
/u/NetBSD/src.ks/external/bsd/ppp/usr.sbin/pppd/sys-bsd.c:314:31: error: request for member 'e32' in something not a structure or union
  314 |     if (default_route_gateway6.e32[0] != 0 || default_route_gateway6.e32[1] != 0)
      |                               ^
/u/NetBSD/src.ks/external/bsd/ppp/usr.sbin/pppd/sys-bsd.c:314:69: error: request for member 'e32' in something not a structure or union
  314 |     if (default_route_gateway6.e32[0] != 0 || default_route_gateway6.e32[1] != 0)
      |                                                                     ^
/u/NetBSD/src.ks/external/bsd/ppp/usr.sbin/pppd/sys-bsd.c:315:2: error: implicit declaration of function 'cif6defaultroute'; did you mean 'cifdefaultroute'? [-Werror=implicit-function-declaration]
  315 |  cif6defaultroute(0, default_route_gateway6, default_route_gateway6);
      |  ^~~~~~~~~~~~~~~~
      |  cifdefaultroute

....

This is remedied by the following patch:


Index: external/bsd/ppp/usr.sbin/pppd/sys-bsd.c
===================================================================
RCS file: /cvsroot/src/external/bsd/ppp/usr.sbin/pppd/sys-bsd.c,v
retrieving revision 1.8
diff -u -r1.8 sys-bsd.c
--- external/bsd/ppp/usr.sbin/pppd/sys-bsd.c    9 Jan 2021 16:39:29 -0000       1.8
+++ external/bsd/ppp/usr.sbin/pppd/sys-bsd.c    11 Jan 2021 21:21:15 -0000
@@ -121,6 +121,8 @@
 #endif
 #include <ifaddrs.h>

+#ifdef INET6
+
 #define s6_addr32 __u6_addr.__u6_addr32        /* Non-standard */

 #define IN6_SOCKADDR_FROM_EUI64(s, eui64) do { \
@@ -149,6 +151,8 @@
 #endif
 #endif

+#endif /* INET6 */
+
 #if RTM_VERSION >= 3
 #include <sys/param.h>
 #if defined(NetBSD) && (NetBSD >= 199703)
@@ -201,8 +205,9 @@
 #endif /* INET6 */
 static u_int32_t ifaddrs[2];   /* local and remote addresses we set */
 static u_int32_t default_route_gateway;        /* gateway addr for default route */
-static eui64_t  default_route_gateway6; /* Gateway for default IPv6 route added
-*/
+#ifdef INET6
+static eui64_t  default_route_gateway6; /* Gateway for default IPv6 route added */
+#endif /* INET6 */
 static u_int32_t proxy_arp_addr;       /* remote addr for proxy arp */

 /* Prototypes for procedures local to this file. */
@@ -307,8 +312,10 @@
        cifaddr(0, ifaddrs[0], ifaddrs[1]);
     if (default_route_gateway)
        cifdefaultroute(0, 0, default_route_gateway);
+#ifdef INET6
     if (default_route_gateway6.e32[0] != 0 || default_route_gateway6.e32[1] != 0)
        cif6defaultroute(0, default_route_gateway6, default_route_gateway6);
+#endif
     if (proxy_arp_addr)
        cifproxyarp(0, proxy_arp_addr);
     doing_cleanup = 0;
@@ -1659,6 +1666,7 @@
 }


+#ifdef INET6
 /*
  * dodefaultroute - assign/clear a default route through the address given.
  */
@@ -1716,6 +1724,7 @@
        return dodefaultroute6(u, l, g, 's');
 }

+
 /*
  * cif6defaultroute - delete a default route through the address given.
  */
@@ -1725,6 +1734,8 @@
        return dodefaultroute6(u, l, g, 'c');
 }

+#endif
+
 #if RTM_VERSION >= 3

 /*




Kurt


Home | Main Index | Thread Index | Old Index