summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwollman <wollman@FreeBSD.org>1995-07-10 16:13:05 +0000
committerwollman <wollman@FreeBSD.org>1995-07-10 16:13:05 +0000
commitc0e94734e2b051cf70c06a120c3d727c31237bcb (patch)
tree623e83746264960f677c6c74e47abd184caa0741
parentae6523c0e56b8a74212d0ae29b9a90665a97064a (diff)
downloadFreeBSD-src-c0e94734e2b051cf70c06a120c3d727c31237bcb.zip
FreeBSD-src-c0e94734e2b051cf70c06a120c3d727c31237bcb.tar.gz
Patches to correct endianness bugs in mtrace and a few other little
problems. Submitted by: bill Fenner <fenner@parc.xerox.com>
-rw-r--r--usr.sbin/mrouted/mrinfo.c4
-rw-r--r--usr.sbin/mrouted/prune.c10
2 files changed, 8 insertions, 6 deletions
diff --git a/usr.sbin/mrouted/mrinfo.c b/usr.sbin/mrouted/mrinfo.c
index f4ccc86..15b0742 100644
--- a/usr.sbin/mrouted/mrinfo.c
+++ b/usr.sbin/mrouted/mrinfo.c
@@ -61,7 +61,7 @@
#ifndef lint
static char rcsid[] =
- "@(#) $Id: mrinfo.c,v 3.6 1995/06/25 19:05:34 fenner Exp $";
+ "@(#) $Id: mrinfo.c,v 1.6 1995/06/28 17:58:36 wollman Exp $";
/* original rcsid:
"@(#) Header: mrinfo.c,v 1.6 93/04/08 15:14:16 van Exp (LBL)";
*/
@@ -461,6 +461,8 @@ main(argc, argv)
ask(target_addr);
else
ask2(target_addr);
+ gettimeofday(&et, 0);
+ et.tv_sec += timeout;
continue;
}
recvlen = recvfrom(igmp_socket, recv_buf, RECV_BUF_SIZE,
diff --git a/usr.sbin/mrouted/prune.c b/usr.sbin/mrouted/prune.c
index f30b056..fe4d507 100644
--- a/usr.sbin/mrouted/prune.c
+++ b/usr.sbin/mrouted/prune.c
@@ -7,7 +7,7 @@
* Leland Stanford Junior University.
*
*
- * $Id: prune.c,v 3.6 1995/06/25 19:18:43 fenner Exp $
+ * $Id: prune.c,v 1.8 1995/06/28 17:58:42 wollman Exp $
*/
@@ -2201,7 +2201,7 @@ accept_mtrace(src, dst, group, data, no, datalen)
bzero(resp, sizeof(struct tr_resp));
datalen += RLEN;
- resp->tr_qarr = ((tp.tv_sec + JAN_1970) << 16) +
+ resp->tr_qarr = htonl((tp.tv_sec + JAN_1970) << 16) +
((tp.tv_usec >> 4) & 0xffff);
resp->tr_rproto = PROTO_DVMRP;
@@ -2219,7 +2219,7 @@ accept_mtrace(src, dst, group, data, no, datalen)
*/
v_req.vifi = vifi;
if (ioctl(udp_socket, SIOCGETVIFCNT, (char *)&v_req) >= 0)
- resp->tr_vifout = v_req.ocount;
+ resp->tr_vifout = htonl(v_req.ocount);
/*
* fill in scoping & pruning information
@@ -2236,7 +2236,7 @@ accept_mtrace(src, dst, group, data, no, datalen)
sg_req.src.s_addr = qry->tr_src;
sg_req.grp.s_addr = group;
if (ioctl(udp_socket, SIOCGETSGCNT, (char *)&sg_req) >= 0)
- resp->tr_pktcnt = sg_req.pktcnt;
+ resp->tr_pktcnt = htonl(sg_req.pktcnt);
if (VIFM_ISSET(vifi, gt->gt_scope))
resp->tr_rflags = TR_SCOPED;
@@ -2267,7 +2267,7 @@ accept_mtrace(src, dst, group, data, no, datalen)
/* get # of packets in on interface */
v_req.vifi = rt->rt_parent;
if (ioctl(udp_socket, SIOCGETVIFCNT, (char *)&v_req) >= 0)
- resp->tr_vifin = v_req.icount;
+ resp->tr_vifin = htonl(v_req.icount);
MASK_TO_VAL(rt->rt_originmask, resp->tr_smask);
src = uvifs[rt->rt_parent].uv_lcl_addr;
OpenPOWER on IntegriCloud