Skip to content

Commit d1b2965

Browse files
xemulavagin
authored andcommitted
net: Support "dumping" dummy sit device
This device is an API endpoint, just skip it. Also, prepare the ground for sit dump. Issue checkpoint-restore#11 Signed-off-by: Pavel Emelyanov <[email protected]>
1 parent 2136eeb commit d1b2965

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

criu/net.c

+28
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,31 @@ static int dump_one_gre(struct ifinfomsg *ifi, char *kind,
658658
return dump_unknown_device(ifi, kind, tb, ns, fds);
659659
}
660660

661+
static int dump_one_sit(struct ifinfomsg *ifi, char *kind,
662+
struct nlattr **tb, struct ns_id *ns, struct cr_imgset *fds)
663+
{
664+
char *name;
665+
666+
if (strcmp(kind, "sit")) {
667+
pr_err("SIT device with %s kind\n", kind);
668+
return -1;
669+
}
670+
671+
name = (char *)RTA_DATA(tb[IFLA_IFNAME]);
672+
if (!name) {
673+
pr_err("sit device %d has no name\n", ifi->ifi_index);
674+
return -1;
675+
}
676+
677+
if (!strcmp(name, "sit0")) {
678+
pr_info("found %s, ignoring\n", name);
679+
return 0;
680+
}
681+
682+
pr_warn("SIT device %s not supported natively\n", name);
683+
return dump_unknown_device(ifi, kind, tb, ns, fds);
684+
}
685+
661686
static int list_one_link(struct nlmsghdr *hdr, struct ns_id *ns, void *arg)
662687
{
663688
return 0;
@@ -701,6 +726,9 @@ static int dump_one_link(struct nlmsghdr *hdr, struct ns_id *ns, void *arg)
701726
case ARPHRD_IPGRE:
702727
ret = dump_one_gre(ifi, kind, tb, ns, fds);
703728
break;
729+
case ARPHRD_SIT:
730+
ret = dump_one_sit(ifi, kind, tb, ns, fds);
731+
break;
704732
default:
705733
unk:
706734
ret = dump_unknown_device(ifi, kind, tb, ns, fds);

0 commit comments

Comments
 (0)