[CRIU] [PATCH v3 6/7] restore net device ipv4 confs

Pavel Tikhomirov ptikhomirov at parallels.com
Wed Oct 1 03:42:41 PDT 2014


Signed-off-by: Pavel Tikhomirov <ptikhomirov at parallels.com>
---
 net.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/net.c b/net.c
index 9d5fce8..7a80973 100644
--- a/net.c
+++ b/net.c
@@ -469,11 +469,23 @@ static int restore_links(int pid)
 	}
 
 	while (1) {
+		char path[PATH_MAX];
+
 		ret = pb_read_one_eof(fd, &nde, PB_NETDEV);
 		if (ret <= 0)
 			break;
 
 		ret = restore_link(nde, nlsk);
+		if (ret) {
+			pr_err("can not restore link");
+			goto exit;
+		}
+
+		snprintf(path, sizeof(path), "net/ipv4/conf/%s", nde->name);
+		ret = ipv4_conf_op(path, nde->conf, CTL_WRITE);
+		if (ret < 0)
+			pr_err("failed to set net device ipv4 conf\n");
+exit:
 		net_device_entry__free_unpacked(nde, NULL);
 		if (ret)
 			break;
-- 
1.9.3



More information about the CRIU mailing list