mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-05-31 00:30:57 +00:00
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:
parent
6f0ab844ea
commit
6716b2e8ab
1 changed files with 16 additions and 0 deletions
|
@ -346,6 +346,22 @@ QW_Master (struct sockaddr_in *addr)
|
||||||
perror ("qf_recvmsg failed\n");
|
perror ("qf_recvmsg failed\n");
|
||||||
continue;
|
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
|
#if 0
|
||||||
ma_log ("Got %d bytes: 0x%x from %s\n", size, buf[0],
|
ma_log ("Got %d bytes: 0x%x from %s\n", size, buf[0],
|
||||||
inet_ntoa (recvaddr.sin_addr));
|
inet_ntoa (recvaddr.sin_addr));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue