From: Zbigniew Jędrzejewski-Szmek Date: Tue, 7 May 2019 11:46:55 +0000 (+0200) Subject: network: remove redunant link name in message X-Git-Tag: v243-rc1~474^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c98b3545008d8e984ab456dcf79787418fcbfe13;p=thirdparty%2Fsystemd.git network: remove redunant link name in message Fixes #12454. gcc was complaining that the link->ifname argument is NULL. Adding assert(link->ifname) right before the call has no effect. It seems that gcc is confused by the fact that log_link_warning_errno() internally calls log_object(), with link->ifname passed as the object. log_object() is also a macro and is does a check whether the passed object is NULL. So we have a check if something is NULL right next an unconditional use of it where it cannot be NULL. I think it's a bug in gcc. Anyway, we don't need to use link->ifname here. log_object() already prepends the object name to the message. --- diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c index 533193ac932..6fc82940033 100644 --- a/src/network/networkd-link.c +++ b/src/network/networkd-link.c @@ -338,8 +338,7 @@ static int link_enable_ipv6(Link *link) { r = sysctl_write_ip_property_boolean(AF_INET6, link->ifname, "disable_ipv6", disabled); if (r < 0) - log_link_warning_errno(link, r, "Cannot %s IPv6 for interface %s: %m", - enable_disable(!disabled), link->ifname); + log_link_warning_errno(link, r, "Cannot %s IPv6: %m", enable_disable(!disabled)); else log_link_info(link, "IPv6 successfully %sd", enable_disable(!disabled));