diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2017-09-27 17:55:13 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2017-09-27 17:55:13 +0200 |
commit | 615ded6233fe89b92576bfc369a4def2920cdc56 (patch) | |
tree | ee2598b0bd1eff81f079042f39a7a4fb93e0c648 | |
parent | core/cgroup: add a helper macro for a common pattern (#6926) (diff) | |
download | systemd-615ded6233fe89b92576bfc369a4def2920cdc56.tar.xz systemd-615ded6233fe89b92576bfc369a4def2920cdc56.zip |
network: change log level when sd_rtnl_message_get_family() returns invalid family (#6923)
From bce67bbee359eec19e6778619b6651100a1c1477, systemd-networkd always shows
```
rtnl: received address with invalid family type 32, ignoring.
```
during boot-up. In the code, there are log_warning() and log_debug() for the
same situation, and the log_debug() is never called. So, let's lower the
log level and remove never called function.
-rw-r--r-- | src/network/networkd-manager.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/network/networkd-manager.c b/src/network/networkd-manager.c index b9cf42d72f..29720a8da0 100644 --- a/src/network/networkd-manager.c +++ b/src/network/networkd-manager.c @@ -757,8 +757,11 @@ int manager_rtnl_process_rule(sd_netlink *rtnl, sd_netlink_message *message, voi } 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; } @@ -798,7 +801,7 @@ int manager_rtnl_process_rule(sd_netlink *rtnl, sd_netlink_message *message, voi break; default: - log_debug("rtnl: ignoring unsupported rule family: %d", family); + assert_not_reached("Received unsupported rule family"); } if (from_prefixlen == 0 && to_prefixlen == 0) |