Download raw body.
Small mrouted improvements
I saw a couple of opportunities to improve mrouted's output.
First, if SIOCGETVIFCNT fails, it's useful to know the error code and
which vif it failed for:
diff --git usr.sbin/mrouted/vif.c usr.sbin/mrouted/vif.c
index 82c2f1b481b..b25f33150d4 100644
--- usr.sbin/mrouted/vif.c
+++ usr.sbin/mrouted/vif.c
@@ -1333,8 +1333,7 @@ dump_vifs(FILE *fp)
}
v_req.vifi = vifi;
if (ioctl(udp_socket, SIOCGETVIFCNT, (char *)&v_req) == -1) {
- logit(LOG_WARNING, 0,
- "SIOCGETVIFCNT fails");
+ logit(LOG_WARNING, errno, "SIOCGETVIFCNT fails for vif %d", vifi);
}
else {
fprintf(fp, " pkts in : %ld\n",
Second, when logging the ratelimit for a multicast peer, include the
units.
diff --git usr.sbin/mrouted/config.c usr.sbin/mrouted/config.c
index 9ba913f577f..a3394f2660c 100644
--- usr.sbin/mrouted/config.c
+++ usr.sbin/mrouted/config.c
@@ -101,7 +101,7 @@ config_vifs_from_kernel(void)
v->uv_acl = NULL;
v->uv_addrs = NULL;
- logit(LOG_INFO,0,"installing %s (%s on subnet %s) as vif #%u - rate=%d",
+ logit(LOG_INFO,0,"installing %s (%s on subnet %s) as vif #%u - rate=%dbit/s",
v->uv_name, inet_fmt(addr, s1), inet_fmts(subnet, mask, s2),
numvifs, v->uv_rate_limit);
--
Russell Howe
rhowe@siksai.co.uk
Small mrouted improvements