[CRIU] [PATCH v2 7/8] restore net device ipv4 confs

Pavel Tikhomirov ptikhomirov at parallels.com
Thu Sep 25 01:00:42 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 8b923d0..01b98ea 100644
--- a/net.c
+++ b/net.c
@@ -475,11 +475,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