}
}
-static void ndisc_router_process_options(Link *link, sd_ndisc_router *rt) {
+static int ndisc_router_process_options(Link *link, sd_ndisc_router *rt) {
int r;
assert(link);
for (;;) {
uint8_t type;
- if (r < 0) {
- log_link_warning_errno(link, r, "Failed to iterate through options: %m");
- return;
- }
+ if (r < 0)
+ return log_link_warning_errno(link, r, "Failed to iterate through options: %m");
if (r == 0) /* EOF */
break;
r = sd_ndisc_router_option_get_type(rt, &type);
- if (r < 0) {
- log_link_warning_errno(link, r, "Failed to get RA option type: %m");
- return;
- }
+ if (r < 0)
+ return log_link_warning_errno(link, r, "Failed to get RA option type: %m");
switch (type) {
uint8_t flags;
r = sd_ndisc_router_prefix_get_flags(rt, &flags);
- if (r < 0) {
- log_link_warning_errno(link, r, "Failed to get RA prefix flags: %m");
- return;
- }
+ 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)
r = sd_ndisc_router_option_next(rt);
}
+
+ return 0;
}
static int ndisc_router_handler(Link *link, sd_ndisc_router *rt) {
}
}
- ndisc_router_process_default(link, rt);
- ndisc_router_process_options(link, rt);
+ (void) ndisc_router_process_default(link, rt);
+ (void) ndisc_router_process_options(link, rt);
return r;
}