mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-01-29 15:43:56 +00:00
added debug output to help track down the recvmsg() control message IDs
on linux (seem to be different than on BSD).
This commit is contained in:
parent
eee99a7893
commit
9d3ab08f1e
10
server.c
10
server.c
@ -69,15 +69,19 @@ int recvwithttl(int sock,unsigned char *buffer,int bufferlen,int *ttl,
|
||||
cmsg != NULL;
|
||||
cmsg = CMSG_NXTHDR(&msg,cmsg)) {
|
||||
|
||||
if ((cmsg->cmsg_level == IPPROTO_IP) && (cmsg->cmsg_type == IP_RECVTTL) &&
|
||||
(cmsg->cmsg_len) ){
|
||||
if ((cmsg->cmsg_level == IPPROTO_IP) &&
|
||||
((cmsg->cmsg_type == IP_RECVTTL) ||(cmsg->cmsg_type == IP_TTL))
|
||||
&&(cmsg->cmsg_len) ){
|
||||
fprintf(stderr," TTL (%p) data location resolves to %p\n",
|
||||
ttl,CMSG_DATA(cmsg));
|
||||
if (CMSG_DATA(cmsg)) {
|
||||
*ttl = *(unsigned char *) CMSG_DATA(cmsg);
|
||||
fprintf(stderr," TTL of packet is %d\n",*ttl);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
fprintf(stderr,"I didn't expect to see level=%02x, type=%02x\n",
|
||||
cmsg->cmsg_level,cmsg->cmsg_type);
|
||||
}
|
||||
}
|
||||
}
|
||||
*recvaddrlen=msg.msg_namelen;
|
||||
|
Loading…
x
Reference in New Issue
Block a user