Skip to content

Commit

Permalink
net: Support "dumping" dummy sit device
Browse files Browse the repository at this point in the history
This device is an API endpoint, just skip it. Also, prepare the
ground for sit dump.

Issue #11

Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
  • Loading branch information
xemul authored and avagin committed Jul 18, 2017
1 parent 2aa15ec commit 383654e
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions criu/net.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 383654e

Please sign in to comment.