]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
network: do not log false friends 2857/head
authorChristian Brauner <christian.brauner@ubuntu.com>
Fri, 15 Feb 2019 22:50:34 +0000 (23:50 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Fri, 15 Feb 2019 22:53:45 +0000 (23:53 +0100)
The netlink functions just return -1 and not specific negative errno values so
logging them doesn't make any sense.

Fixes: https://discuss.linuxcontainers.org/t/warning-in-the-container-log/4072/2
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/network.c

index e05c5661577420bb2a7bd5f5059aba17c866ee9e..fd7d867fc58a74edafac5bc5026432c519244a56 100644 (file)
@@ -2581,10 +2581,9 @@ bool lxc_delete_network_priv(struct lxc_handler *handler)
                             netdev->name[0] != '\0' ? netdev->name : "(null)",
                             netdev->ifindex);
                } else if (ret < 0) {
-                       errno = -ret;
-                       SYSWARN("Failed to remove interface \"%s\" with index %d",
-                               netdev->name[0] != '\0' ? netdev->name : "(null)",
-                               netdev->ifindex);
+                       WARN("Failed to remove interface \"%s\" with index %d",
+                            netdev->name[0] != '\0' ? netdev->name : "(null)",
+                            netdev->ifindex);
                        goto clear_ifindices;
                }
                INFO("Removed interface \"%s\" with index %d",
@@ -2606,9 +2605,8 @@ bool lxc_delete_network_priv(struct lxc_handler *handler)
 
                ret = lxc_netdev_delete_by_name(hostveth);
                if (ret < 0) {
-                       errno = -ret;
-                       SYSWARN("Failed to remove interface \"%s\" from \"%s\"",
-                               hostveth, netdev->link);
+                       WARN("Failed to remove interface \"%s\" from \"%s\"",
+                            hostveth, netdev->link);
                        goto clear_ifindices;
                }
                INFO("Removed interface \"%s\" from \"%s\"", hostveth, netdev->link);