Changeset View
Changeset View
Standalone View
Standalone View
head/sbin/ifconfig/iflagg.c
Show First 20 Lines • Show All 108 Lines • ▼ Show 20 Lines | |||||
static void | static void | ||||
setlaggrr_limit(const char *val, int d, int s, const struct afswtch *afp) | setlaggrr_limit(const char *val, int d, int s, const struct afswtch *afp) | ||||
{ | { | ||||
struct lagg_reqopts ro; | struct lagg_reqopts ro; | ||||
bzero(&ro, sizeof(ro)); | bzero(&ro, sizeof(ro)); | ||||
strlcpy(ro.ro_ifname, name, sizeof(ro.ro_ifname)); | strlcpy(ro.ro_ifname, name, sizeof(ro.ro_ifname)); | ||||
ro.ro_bkt = (int)strtol(val, NULL, 10); | ro.ro_opts = LAGG_OPT_RR_LIMIT; | ||||
ro.ro_bkt = (uint32_t)strtoul(val, NULL, 10); | |||||
if (ro.ro_bkt == 0) | |||||
errx(1, "Invalid round-robin stride: %s", val); | |||||
if (ioctl(s, SIOCSLAGGOPTS, &ro) != 0) | if (ioctl(s, SIOCSLAGGOPTS, &ro) != 0) | ||||
err(1, "SIOCSLAGG"); | err(1, "SIOCSLAGGOPTS"); | ||||
} | } | ||||
static void | static void | ||||
setlaggsetopt(const char *val, int d, int s, const struct afswtch *afp) | setlaggsetopt(const char *val, int d, int s, const struct afswtch *afp) | ||||
{ | { | ||||
struct lagg_reqopts ro; | struct lagg_reqopts ro; | ||||
bzero(&ro, sizeof(ro)); | bzero(&ro, sizeof(ro)); | ||||
▲ Show 20 Lines • Show All 207 Lines • Show Last 20 Lines |