Add some disabled test code for interface access.

As part of the work on getting nq to work on multi-homed nodes, I used the
existing recvmsg code in qw-master to check how things work. I figured it
might be worth keeping.
This commit is contained in:
Bill Currie 2011-08-06 17:21:54 +09:00
parent 6f0ab844ea
commit 6716b2e8ab

View file

@ -346,6 +346,22 @@ QW_Master (struct sockaddr_in *addr)
perror ("qf_recvmsg failed\n");
continue;
}
#if 0
{
/* Dump the destination information (ie, our iface/address) of
* the packet. Mostly so I know how this stuff works.
*/
struct cmsghdr *cmsg;
for (cmsg = CMSG_FIRSTHDR (&msghdr); cmsg;
cmsg = CMSG_NXTHDR (&msghdr, cmsg)) {
struct in_pktinfo *d;
d = (struct in_pktinfo *) CMSG_DATA (cmsg);
printf ("iface %d %s %s\n", d->ipi_ifindex,
inet_ntoa(d->ipi_spec_dst), inet_ntoa (d->ipi_addr));
}
}
#endif
#if 0
ma_log ("Got %d bytes: 0x%x from %s\n", size, buf[0],
inet_ntoa (recvaddr.sin_addr));