[CRIU] [PATCH 1/4] net: Support "dumping" dummy sit device

Pavel Emelyanov xemul at virtuozzo.com
Wed Jul 5 16:59:29 MSK 2017


This device is an API endpoint, just skip it. Also, prepare the
ground for sit dump.

Issue #11

Signed-off-by: Pavel Emelyanov <xemul at virtuozzo.com>
---
 criu/net.c | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/criu/net.c b/criu/net.c
index 15aae2b..9dda92a 100644
--- a/criu/net.c
+++ b/criu/net.c
@@ -658,6 +658,31 @@ static int dump_one_gre(struct ifinfomsg *ifi, char *kind,
 	return dump_unknown_device(ifi, kind, tb, ns, fds);
 }
 
+static int dump_one_sit(struct ifinfomsg *ifi, char *kind,
+		struct nlattr **tb, struct ns_id *ns, struct cr_imgset *fds)
+{
+	char *name;
+
+	if (strcmp(kind, "sit")) {
+		pr_err("SIT device with %s kind\n", kind);
+		return -1;
+	}
+
+	name = (char *)RTA_DATA(tb[IFLA_IFNAME]);
+	if (!name) {
+		pr_err("sit device %d has no name\n", ifi->ifi_index);
+		return -1;
+	}
+
+	if (!strcmp(name, "sit0")) {
+		pr_info("found %s, ignoring\n", name);
+		return 0;
+	}
+
+	pr_warn("SIT device %s not supported natively\n", name);
+	return dump_unknown_device(ifi, kind, tb, ns, fds);
+}
+
 static int list_one_link(struct nlmsghdr *hdr, struct ns_id *ns, void *arg)
 {
 	return 0;
@@ -701,6 +726,9 @@ static int dump_one_link(struct nlmsghdr *hdr, struct ns_id *ns, void *arg)
 	case ARPHRD_IPGRE:
 		ret = dump_one_gre(ifi, kind, tb, ns, fds);
 		break;
+	case ARPHRD_SIT:
+		ret = dump_one_sit(ifi, kind, tb, ns, fds);
+		break;
 	default:
 unk:
 		ret = dump_unknown_device(ifi, kind, tb, ns, fds);
-- 
2.1.4



More information about the CRIU mailing list