Changeset View
Changeset View
Standalone View
Standalone View
head/sbin/ifconfig/ifclone.c
Show First 20 Lines • Show All 138 Lines • ▼ Show 20 Lines | if (clone_cb == NULL) { | ||||
/* NB: no parameters */ | /* NB: no parameters */ | ||||
if (ioctl(s, SIOCIFCREATE2, &ifr) < 0) | if (ioctl(s, SIOCIFCREATE2, &ifr) < 0) | ||||
err(1, "SIOCIFCREATE2"); | err(1, "SIOCIFCREATE2"); | ||||
} else { | } else { | ||||
clone_cb(s, &ifr); | clone_cb(s, &ifr); | ||||
} | } | ||||
/* | /* | ||||
* If we get a different name back than we put in, print it. | * If we get a different name back than we put in, update record and | ||||
* indicate it should be printed later. | |||||
*/ | */ | ||||
if (strncmp(name, ifr.ifr_name, sizeof(name)) != 0) { | if (strncmp(name, ifr.ifr_name, sizeof(name)) != 0) { | ||||
strlcpy(name, ifr.ifr_name, sizeof(name)); | strlcpy(name, ifr.ifr_name, sizeof(name)); | ||||
printf("%s\n", name); | printifname = 1; | ||||
} | } | ||||
} | } | ||||
static | static | ||||
DECL_CMD_FUNC(clone_create, arg, d) | DECL_CMD_FUNC(clone_create, arg, d) | ||||
{ | { | ||||
callback_register(ifclonecreate, NULL); | callback_register(ifclonecreate, NULL); | ||||
} | } | ||||
Show All 33 Lines |