summaryrefslogtreecommitdiff
path: root/src/network/networkd-ndisc.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2019-02-26 14:36:07 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2019-02-27 16:48:19 +0900
commit87d8a4dee8a5fccb046d315341cd89d09bc1075e (patch)
tree7e49c64ebb0836c6c30ebb51ccd0fd87ae7908ea /src/network/networkd-ndisc.c
parente8c9b5b06f762254d17e41663760708cba8ede79 (diff)
downloadsystemd-87d8a4dee8a5fccb046d315341cd89d09bc1075e.tar.gz
network: merge conditions and use FLAGS_SET() macro
Diffstat (limited to 'src/network/networkd-ndisc.c')
-rw-r--r--src/network/networkd-ndisc.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/network/networkd-ndisc.c b/src/network/networkd-ndisc.c
index d99c0670e8..eb470a4d48 100644
--- a/src/network/networkd-ndisc.c
+++ b/src/network/networkd-ndisc.c
@@ -521,13 +521,13 @@ static int ndisc_router_process_options(Link *link, sd_ndisc_router *rt) {
if (r < 0)
return log_link_warning_errno(link, r, "Failed to get RA prefix flags: %m");
- if (link->network->ipv6_accept_ra_use_onlink_prefix)
- if (flags & ND_OPT_PI_FLAG_ONLINK)
- (void) ndisc_router_process_onlink_prefix(link, rt);
+ if (link->network->ipv6_accept_ra_use_onlink_prefix &&
+ FLAGS_SET(flags, ND_OPT_PI_FLAG_ONLINK))
+ (void) ndisc_router_process_onlink_prefix(link, rt);
- if (link->network->ipv6_accept_ra_use_autonomous_prefix)
- if (flags & ND_OPT_PI_FLAG_AUTO)
- (void) ndisc_router_process_autonomous_prefix(link, rt);
+ if (link->network->ipv6_accept_ra_use_autonomous_prefix &&
+ FLAGS_SET(flags, ND_OPT_PI_FLAG_AUTO))
+ (void) ndisc_router_process_autonomous_prefix(link, rt);
break;
}