platform: properly change netns in do_change_link()
authorThomas Haller <thaller@redhat.com>
Tue, 8 Mar 2016 12:02:09 +0000 (13:02 +0100)
committerThomas Haller <thaller@redhat.com>
Tue, 15 Mar 2016 11:56:57 +0000 (12:56 +0100)
src/platform/nm-linux-platform.c

index eaa302a..3536fd4 100644 (file)
@@ -3881,6 +3881,7 @@ do_change_link (NMPlatform *platform,
                 int ifindex,
                 struct nl_msg *nlmsg)
 {
+       nm_auto_pop_netns NMPNetns *netns = NULL;
        WaitForNlResponseResult seq_result = WAIT_FOR_NL_RESPONSE_RESULT_UNKNOWN;
        int nle;
        char s_buf[256];
@@ -3888,6 +3889,9 @@ do_change_link (NMPlatform *platform,
        NMLogLevel log_level = LOGL_DEBUG;
        const char *log_result = "failure", *log_detail = "";
 
+       if (!nm_platform_netns_push (platform, &netns))
+               return NM_PLATFORM_ERROR_UNSPECIFIED;
+
 retry:
        nle = _nl_send_auto_with_seq (platform, nlmsg, &seq_result);
        if (nle < 0) {