X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Flibsystemd%2Fsd-rtnl%2Frtnl-util.c;h=194a267b04b88af126235ee2f63a17a9035871f7;hb=2263bb9a92f25571f837700cfee4fb79721baf46;hp=1ec1fa8d27905c7b5a77b7765983624a3a877da4;hpb=aedca89268ed4fd6be41e55a605f011033ad1fb5;p=elogind.git diff --git a/src/libsystemd/sd-rtnl/rtnl-util.c b/src/libsystemd/sd-rtnl/rtnl-util.c index 1ec1fa8d2..194a267b0 100644 --- a/src/libsystemd/sd-rtnl/rtnl-util.c +++ b/src/libsystemd/sd-rtnl/rtnl-util.c @@ -122,6 +122,17 @@ int rtnl_message_new_synthetic_error(int error, uint32_t serial, sd_rtnl_message return 0; } +bool rtnl_message_type_is_neigh(uint16_t type) { + switch (type) { + case RTM_NEWNEIGH: + case RTM_GETNEIGH: + case RTM_DELNEIGH: + return true; + default: + return false; + } +} + bool rtnl_message_type_is_route(uint16_t type) { switch (type) { case RTM_NEWROUTE: @@ -157,11 +168,9 @@ bool rtnl_message_type_is_addr(uint16_t type) { } int rtnl_log_parse_error(int r) { - log_error("Failed to parse netlink message: %s", strerror(-r)); - return r; + return log_error_errno(r, "Failed to parse netlink message: %m"); } int rtnl_log_create_error(int r) { - log_error("Failed to create netlink message: %s", strerror(-r)); - return r; + return log_error_errno(r, "Failed to create netlink message: %m"); }