Containerized syslog working properly
[safe/jmp/linux-2.6] / net / core / rtnetlink.c
index 1a2af24..5f7cf87 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/types.h>
 #include <linux/socket.h>
 #include <linux/kernel.h>
+#include <linux/syslog.h>
 #include <linux/timer.h>
 #include <linux/string.h>
 #include <linux/sockios.h>
@@ -1082,6 +1083,13 @@ static int do_setlink(struct net_device *dev, struct ifinfomsg *ifm,
                        err = PTR_ERR(net);
                        goto errout;
                }
+               if (dev) {
+                       register pid_t net_ns_pid;
+
+                       net_ns_pid = nla_get_u32(tb[IFLA_NET_NS_PID]);
+                       dev->syslog_ns = find_syslog_ns_bypid(net_ns_pid);
+               }
+
                err = dev_change_net_namespace(dev, net, ifname);
                put_net(net);
                if (err)