Commit a10e99af authored by Kevin Bracey's avatar Kevin Bracey
Browse files

Required TTL now calculated correctly.

parent ebf6f6f5
......@@ -369,6 +369,9 @@ void k_hdr_include __P((int bool));
void k_set_ttl __P((int t));
void k_set_loop __P((int l));
void k_set_if __P((u_int32 ifa));
#ifdef __riscos
void k_set_sleep __P((int s));
#endif
void k_join __P((u_int32 grp, u_int32 ifa));
void k_leave __P((u_int32 grp, u_int32 ifa));
char * inet_fmt __P((u_int32 addr, char *s));
......@@ -439,6 +442,9 @@ init_igmp()
if ((igmp_socket = socket(AF_INET, SOCK_RAW, IPPROTO_IGMP)) < 0)
log(LOG_ERR, errno, "IGMP socket");
#ifdef __riscos
k_set_sleep(TRUE); /* sleep taskwindows */
#endif
k_hdr_include(TRUE); /* include IP header when sending */
k_set_rcvbuf(48*1024); /* lots of input buffering */
k_set_ttl(1); /* restrict multicasts to one hop */
......@@ -716,6 +722,16 @@ k_set_loop(l)
log(LOG_ERR, errno, "setsockopt IP_MULTICAST_LOOP %u", loop);
}
#ifdef __riscos
void
k_set_sleep(s)
int s;
{
if (ioctl(igmp_socket, FIOSLEEPTW, &s) < 0)
log(LOG_ERR, errno, "ioctl FIOSLEEPTW %u", s);
}
#endif
void
k_set_if(ifa)
u_int32 ifa;
......@@ -3052,11 +3068,11 @@ or multicast at ttl %d doesn't reach its last-hop router for that source\n",
printf("Round trip time %d ms; ", t_diff(base.rtime, base.qtime));
{
struct tr_resp *n = base.resps + base.len - 1;
u_int ttl = n->tr_fttl + 1;
struct tr_resp *n = base.resps + base.len;
u_int ttl = 0;
rno = base.len - 1;
while (--rno > 0) {
rno = base.len;
while (--rno >= 0) {
--n;
ttl = MaX(ttl, MaX(1, n->tr_fttl) + base.len - rno);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment