@@ -650,31 +650,37 @@ parse_option(struct dhcpcd_ctx *ctx, const char *ifname, struct if_options *ifo,
650
650
ssize_t s ;
651
651
struct in_addr addr , addr2 ;
652
652
in_addr_t * naddr ;
653
- struct rt * rt ;
654
653
const struct dhcp_opt * d , * od ;
655
654
uint8_t * request , * require , * no , * reject ;
656
655
struct dhcp_opt * * dop , * ndop ;
657
656
size_t * dop_len , dl , odl ;
658
- struct vivco * vivco ;
659
- const struct vivco * vivco_endp = ifo -> vivco + ifo -> vivco_len ;
660
657
struct group * grp ;
661
658
#ifdef AUTH
662
659
struct token * token ;
663
660
#endif
664
661
#ifdef _REENTRANT
665
662
struct group grpbuf ;
666
663
#endif
664
+ #ifdef INET
665
+ struct rt * rt ;
666
+ #endif
667
667
#ifdef DHCP6
668
- size_t sl ;
669
668
struct if_ia * ia ;
670
669
uint8_t iaid [4 ];
670
+ #endif
671
+ #if defined(DHCP6 ) || ((defined(INET ) || defined(INET6 )) && !defined(SMALL ))
672
+ size_t sl ;
673
+ #endif
671
674
#ifndef SMALL
672
- struct in6_addr in6addr ;
675
+ #ifdef DHCP6
673
676
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 ;
674
681
struct vsio * * vsiop = NULL , * vsio ;
675
682
size_t * vsio_lenp = NULL , opt_max , opt_header ;
676
683
struct vsio_so * vsio_so ;
677
- #endif
678
684
#endif
679
685
680
686
dop = NULL ;
@@ -1308,6 +1314,7 @@ parse_option(struct dhcpcd_ctx *ctx, const char *ifname, struct if_options *ifo,
1308
1314
strncmp (arg , "ms_classless_static_routes=" ,
1309
1315
strlen ("ms_classless_static_routes=" )) == 0 )
1310
1316
{
1317
+ #ifdef INET
1311
1318
struct in_addr addr3 ;
1312
1319
1313
1320
if (p == NULL ) {
@@ -1337,7 +1344,12 @@ parse_option(struct dhcpcd_ctx *ctx, const char *ifname, struct if_options *ifo,
1337
1344
sa_in_init (& rt -> rt_gateway , & addr3 );
1338
1345
if (rt_proto_add_ctx (& ifo -> routes , rt , ctx ))
1339
1346
add_environ (& ifo -> config , arg , 0 );
1347
+ #else
1348
+ logerrx ("no inet support for option: %s" , arg );
1349
+ return -1 ;
1350
+ #endif
1340
1351
} else if (strncmp (arg , "routers=" , strlen ("routers=" )) == 0 ) {
1352
+ #ifdef INET
1341
1353
if (p == NULL ) {
1342
1354
rt_headclear (& ifo -> routes , AF_INET );
1343
1355
add_environ (& ifo -> config , arg , 1 );
@@ -1353,6 +1365,10 @@ parse_option(struct dhcpcd_ctx *ctx, const char *ifname, struct if_options *ifo,
1353
1365
sa_in_init (& rt -> rt_gateway , & addr );
1354
1366
if (rt_proto_add_ctx (& ifo -> routes , rt , ctx ))
1355
1367
add_environ (& ifo -> config , arg , 0 );
1368
+ #else
1369
+ logerrx ("no inet support for option: %s" , arg );
1370
+ return -1 ;
1371
+ #endif
1356
1372
} else if (strncmp (arg , "interface_mtu=" ,
1357
1373
strlen ("interface_mtu=" )) == 0 ||
1358
1374
strncmp (arg , "mtu=" , strlen ("mtu=" )) == 0 )
@@ -1366,6 +1382,7 @@ parse_option(struct dhcpcd_ctx *ctx, const char *ifname, struct if_options *ifo,
1366
1382
return -1 ;
1367
1383
}
1368
1384
} else if (strncmp (arg , "ip6_address=" , strlen ("ip6_address=" )) == 0 ) {
1385
+ #ifdef INET6
1369
1386
if (p == NULL ) {
1370
1387
memset (& ifo -> req_addr6 , 0 ,
1371
1388
sizeof (ifo -> req_addr6 ));
@@ -1396,6 +1413,10 @@ parse_option(struct dhcpcd_ctx *ctx, const char *ifname, struct if_options *ifo,
1396
1413
sizeof (ifo -> req_addr6 ));
1397
1414
return -1 ;
1398
1415
}
1416
+ #else
1417
+ logerrx ("no inet6 support for option: %s" , arg );
1418
+ return -1 ;
1419
+ #endif
1399
1420
} else
1400
1421
add_environ (& ifo -> config , arg , p == NULL ? 1 : 0 );
1401
1422
break ;
@@ -2951,11 +2972,11 @@ free_options(struct dhcpcd_ctx *ctx, struct if_options *ifo)
2951
2972
struct rt * rt ;
2952
2973
#endif
2953
2974
struct dhcp_opt * opt ;
2954
- struct vivco * vo ;
2955
2975
#ifdef AUTH
2956
2976
struct token * token ;
2957
2977
#endif
2958
2978
#ifndef SMALL
2979
+ struct vivco * vo ;
2959
2980
struct vsio * vsio ;
2960
2981
struct vsio_so * vsio_so ;
2961
2982
#endif
0 commit comments