@@ -650,31 +650,37 @@ parse_option(struct dhcpcd_ctx *ctx, const char *ifname, struct if_options *ifo,
650650 ssize_t s ;
651651 struct in_addr addr , addr2 ;
652652 in_addr_t * naddr ;
653- struct rt * rt ;
654653 const struct dhcp_opt * d , * od ;
655654 uint8_t * request , * require , * no , * reject ;
656655 struct dhcp_opt * * dop , * ndop ;
657656 size_t * dop_len , dl , odl ;
658- struct vivco * vivco ;
659- const struct vivco * vivco_endp = ifo -> vivco + ifo -> vivco_len ;
660657 struct group * grp ;
661658#ifdef AUTH
662659 struct token * token ;
663660#endif
664661#ifdef _REENTRANT
665662 struct group grpbuf ;
666663#endif
664+ #ifdef INET
665+ struct rt * rt ;
666+ #endif
667667#ifdef DHCP6
668- size_t sl ;
669668 struct if_ia * ia ;
670669 uint8_t iaid [4 ];
670+ #endif
671+ #if defined(DHCP6 ) || ((defined(INET ) || defined(INET6 )) && !defined(SMALL ))
672+ size_t sl ;
673+ #endif
671674#ifndef SMALL
672- struct in6_addr in6addr ;
675+ #ifdef DHCP6
673676 struct if_sla * sla , * slap ;
677+ #endif
678+ struct vivco * vivco ;
679+ const struct vivco * vivco_endp = ifo -> vivco + ifo -> vivco_len ;
680+ struct in6_addr in6addr ;
674681 struct vsio * * vsiop = NULL , * vsio ;
675682 size_t * vsio_lenp = NULL , opt_max , opt_header ;
676683 struct vsio_so * vsio_so ;
677- #endif
678684#endif
679685
680686 dop = NULL ;
@@ -1308,6 +1314,7 @@ parse_option(struct dhcpcd_ctx *ctx, const char *ifname, struct if_options *ifo,
13081314 strncmp (arg , "ms_classless_static_routes=" ,
13091315 strlen ("ms_classless_static_routes=" )) == 0 )
13101316 {
1317+ #ifdef INET
13111318 struct in_addr addr3 ;
13121319
13131320 if (p == NULL ) {
@@ -1337,7 +1344,12 @@ parse_option(struct dhcpcd_ctx *ctx, const char *ifname, struct if_options *ifo,
13371344 sa_in_init (& rt -> rt_gateway , & addr3 );
13381345 if (rt_proto_add_ctx (& ifo -> routes , rt , ctx ))
13391346 add_environ (& ifo -> config , arg , 0 );
1347+ #else
1348+ logerrx ("no inet support for option: %s" , arg );
1349+ return -1 ;
1350+ #endif
13401351 } else if (strncmp (arg , "routers=" , strlen ("routers=" )) == 0 ) {
1352+ #ifdef INET
13411353 if (p == NULL ) {
13421354 rt_headclear (& ifo -> routes , AF_INET );
13431355 add_environ (& ifo -> config , arg , 1 );
@@ -1353,6 +1365,10 @@ parse_option(struct dhcpcd_ctx *ctx, const char *ifname, struct if_options *ifo,
13531365 sa_in_init (& rt -> rt_gateway , & addr );
13541366 if (rt_proto_add_ctx (& ifo -> routes , rt , ctx ))
13551367 add_environ (& ifo -> config , arg , 0 );
1368+ #else
1369+ logerrx ("no inet support for option: %s" , arg );
1370+ return -1 ;
1371+ #endif
13561372 } else if (strncmp (arg , "interface_mtu=" ,
13571373 strlen ("interface_mtu=" )) == 0 ||
13581374 strncmp (arg , "mtu=" , strlen ("mtu=" )) == 0 )
@@ -1366,6 +1382,7 @@ parse_option(struct dhcpcd_ctx *ctx, const char *ifname, struct if_options *ifo,
13661382 return -1 ;
13671383 }
13681384 } else if (strncmp (arg , "ip6_address=" , strlen ("ip6_address=" )) == 0 ) {
1385+ #ifdef INET6
13691386 if (p == NULL ) {
13701387 memset (& ifo -> req_addr6 , 0 ,
13711388 sizeof (ifo -> req_addr6 ));
@@ -1396,6 +1413,10 @@ parse_option(struct dhcpcd_ctx *ctx, const char *ifname, struct if_options *ifo,
13961413 sizeof (ifo -> req_addr6 ));
13971414 return -1 ;
13981415 }
1416+ #else
1417+ logerrx ("no inet6 support for option: %s" , arg );
1418+ return -1 ;
1419+ #endif
13991420 } else
14001421 add_environ (& ifo -> config , arg , p == NULL ? 1 : 0 );
14011422 break ;
@@ -2951,11 +2972,11 @@ free_options(struct dhcpcd_ctx *ctx, struct if_options *ifo)
29512972 struct rt * rt ;
29522973#endif
29532974 struct dhcp_opt * opt ;
2954- struct vivco * vo ;
29552975#ifdef AUTH
29562976 struct token * token ;
29572977#endif
29582978#ifndef SMALL
2979+ struct vivco * vo ;
29592980 struct vsio * vsio ;
29602981 struct vsio_so * vsio_so ;
29612982#endif
0 commit comments