summaryrefslogtreecommitdiffstats
path: root/freebsd/sbin/ifconfig/iflagg.c
diff options
context:
space:
mode:
Diffstat (limited to 'freebsd/sbin/ifconfig/iflagg.c')
-rw-r--r--freebsd/sbin/ifconfig/iflagg.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/freebsd/sbin/ifconfig/iflagg.c b/freebsd/sbin/ifconfig/iflagg.c
index 4952196a..c328cf3b 100644
--- a/freebsd/sbin/ifconfig/iflagg.c
+++ b/freebsd/sbin/ifconfig/iflagg.c
@@ -126,10 +126,13 @@ setlaggrr_limit(const char *val, int d, int s, const struct afswtch *afp)
bzero(&ro, sizeof(ro));
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)
- err(1, "SIOCSLAGG");
+ err(1, "SIOCSLAGGOPTS");
}
static void