File tree Expand file tree Collapse file tree 4 files changed +7
-15
lines changed
Expand file tree Collapse file tree 4 files changed +7
-15
lines changed Original file line number Diff line number Diff line change @@ -430,9 +430,7 @@ bool link_dhcp6_pd_is_enabled(Link *link) {
430430 if (!link -> network )
431431 return false;
432432
433- return IN_SET (link -> network -> router_prefix_delegation ,
434- RADV_PREFIX_DELEGATION_DHCP6 ,
435- RADV_PREFIX_DELEGATION_BOTH );
433+ return link -> network -> router_prefix_delegation & RADV_PREFIX_DELEGATION_DHCP6 ;
436434}
437435
438436static bool link_has_preferred_subnet_id (Link * link ) {
Original file line number Diff line number Diff line change @@ -1394,9 +1394,7 @@ static int link_request_set_addresses(Link *link) {
13941394 return r ;
13951395 }
13961396
1397- if (IN_SET (link -> network -> router_prefix_delegation ,
1398- RADV_PREFIX_DELEGATION_STATIC ,
1399- RADV_PREFIX_DELEGATION_BOTH ))
1397+ if (link -> network -> router_prefix_delegation & RADV_PREFIX_DELEGATION_STATIC )
14001398 LIST_FOREACH (prefixes , p , link -> network -> static_prefixes ) {
14011399 _cleanup_ (address_freep ) Address * address = NULL ;
14021400
Original file line number Diff line number Diff line change @@ -650,10 +650,7 @@ int radv_configure(Link *link) {
650650 return r ;
651651 }
652652
653- if (IN_SET (link -> network -> router_prefix_delegation ,
654- RADV_PREFIX_DELEGATION_STATIC ,
655- RADV_PREFIX_DELEGATION_BOTH )) {
656-
653+ if (link -> network -> router_prefix_delegation & RADV_PREFIX_DELEGATION_STATIC ) {
657654 LIST_FOREACH (prefixes , p , link -> network -> static_prefixes ) {
658655 r = sd_radv_add_prefix (link -> radv , p -> radv_prefix , false);
659656 if (r == - EEXIST )
@@ -673,7 +670,6 @@ int radv_configure(Link *link) {
673670 if (r < 0 )
674671 return r ;
675672 }
676-
677673 }
678674
679675 return 0 ;
Original file line number Diff line number Diff line change @@ -14,10 +14,10 @@ typedef struct Prefix Prefix;
1414typedef struct RoutePrefix RoutePrefix ;
1515
1616typedef enum RADVPrefixDelegation {
17- RADV_PREFIX_DELEGATION_NONE ,
18- RADV_PREFIX_DELEGATION_STATIC ,
19- RADV_PREFIX_DELEGATION_DHCP6 ,
20- RADV_PREFIX_DELEGATION_BOTH ,
17+ RADV_PREFIX_DELEGATION_NONE = 0 ,
18+ RADV_PREFIX_DELEGATION_STATIC = 1 << 0 ,
19+ RADV_PREFIX_DELEGATION_DHCP6 = 1 << 1 ,
20+ RADV_PREFIX_DELEGATION_BOTH = RADV_PREFIX_DELEGATION_STATIC | RADV_PREFIX_DELEGATION_DHCP6 ,
2121 _RADV_PREFIX_DELEGATION_MAX ,
2222 _RADV_PREFIX_DELEGATION_INVALID = -1 ,
2323} RADVPrefixDelegation ;
You can’t perform that action at this time.
0 commit comments