]>
Commit | Line | Data |
---|---|---|
90e41e0d JR |
1 | From c98b3545008d8e984ab456dcf79787418fcbfe13 Mon Sep 17 00:00:00 2001 |
2 | From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl> | |
3 | Date: Tue, 7 May 2019 13:46:55 +0200 | |
4 | Subject: [PATCH] network: remove redunant link name in message | |
5 | ||
6 | Fixes #12454. | |
7 | ||
8 | gcc was complaining that the link->ifname argument is NULL. Adding | |
9 | assert(link->ifname) right before the call has no effect. It seems that | |
10 | gcc is confused by the fact that log_link_warning_errno() internally | |
11 | calls log_object(), with link->ifname passed as the object. log_object() | |
12 | is also a macro and is does a check whether the passed object is NULL. | |
13 | So we have a check if something is NULL right next an unconditional use | |
14 | of it where it cannot be NULL. I think it's a bug in gcc. | |
15 | ||
16 | Anyway, we don't need to use link->ifname here. log_object() already prepends | |
17 | the object name to the message. | |
18 | --- | |
19 | src/network/networkd-link.c | 3 +-- | |
20 | 1 file changed, 1 insertion(+), 2 deletions(-) | |
21 | ||
22 | diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c | |
23 | index 533193ac932..6fc82940033 100644 | |
24 | --- a/src/network/networkd-link.c | |
25 | +++ b/src/network/networkd-link.c | |
26 | @@ -338,8 +338,7 @@ static int link_enable_ipv6(Link *link) { | |
27 | ||
28 | r = sysctl_write_ip_property_boolean(AF_INET6, link->ifname, "disable_ipv6", disabled); | |
29 | if (r < 0) | |
30 | - log_link_warning_errno(link, r, "Cannot %s IPv6 for interface %s: %m", | |
31 | - enable_disable(!disabled), link->ifname); | |
32 | + log_link_warning_errno(link, r, "Cannot %s IPv6: %m", enable_disable(!disabled)); | |
33 | else | |
34 | log_link_info(link, "IPv6 successfully %sd", enable_disable(!disabled)); | |
35 |