"/etc/systemd/network",
"/run/systemd/network",
"/usr/lib/systemd/network",
-#ifdef HAVE_SPLIT_USR
+#if HAVE_SPLIT_USR
"/lib/systemd/network",
#endif
NULL};
if (r < 0) {
log_warning_errno(r, "rtnl: could not get message type: %m");
return 0;
- } else if (type != RTM_NEWROUTE && type != RTM_DELROUTE) {
+ } else if (!IN_SET(type, RTM_NEWROUTE, RTM_DELROUTE)) {
log_warning("rtnl: received unexpected message type when processing route");
return 0;
}
break;
default:
- log_link_debug(link, "rtnl: ignoring unsupported address family: %d", family);
+ assert_not_reached("Received unsupported address family");
return 0;
}
if (r < 0) {
log_warning_errno(r, "rtnl: could not get message type: %m");
return 0;
- } else if (type != RTM_NEWADDR && type != RTM_DELADDR) {
+ } else if (!IN_SET(type, RTM_NEWADDR, RTM_DELADDR)) {
log_warning("rtnl: received unexpected message type when processing address");
return 0;
}
if (r < 0) {
log_warning_errno(r, "rtnl: Could not get message type: %m");
return 0;
- } else if (type != RTM_NEWLINK && type != RTM_DELLINK) {
+ } else if (!IN_SET(type, RTM_NEWLINK, RTM_DELLINK)) {
log_warning("rtnl: Received unexpected message type when processing link");
return 0;
}
}
r = sd_rtnl_message_get_family(message, &family);
- if (r < 0 || !IN_SET(family, AF_INET, AF_INET6)) {
- log_warning_errno(r, "rtnl: received address with invalid family type %u, ignoring.", type);
+ if (r < 0) {
+ log_warning_errno(r, "rtnl: could not get rule family: %m");
+ return 0;
+ } else if (!IN_SET(family, AF_INET, AF_INET6)) {
+ log_debug("rtnl: received address with invalid family %u, ignoring.", family);
return 0;
}
break;
default:
- log_debug("rtnl: ignoring unsupported rule family: %d", family);
+ assert_not_reached("Received unsupported address family");
}
if (from_prefixlen == 0 && to_prefixlen == 0)