1
0
Fork 0
mirror of https://repo.or.cz/socat.git synced 2025-07-14 23:33:23 +00:00

Corrected byte order on read of IPV6_TCLASS value from ancillary message

This commit is contained in:
Gerhard Rieger 2017-01-21 13:42:09 +01:00
parent a2086478e6
commit 9b2275bcdd
2 changed files with 8 additions and 2 deletions

View file

@ -292,11 +292,14 @@ int xiolog_ancillary_ip6(struct cmsghdr *cmsg, int *num,
return STAT_OK;
#endif
#ifdef IPV6_TCLASS
case IPV6_TCLASS:
case IPV6_TCLASS: {
unsigned int u;
typbuff[0] = '\0'; strncat(typbuff, "IPV6_TCLASS", typlen-1);
nambuff[0] = '\0'; strncat(nambuff, "tclass", namlen-1);
xiodump(CMSG_DATA(cmsg), msglen, valbuff, vallen, 0);
u = ntohl(*(unsigned int *)CMSG_DATA(cmsg));
xiodump((const unsigned char *)&u, msglen, valbuff, vallen, 0);
return STAT_OK;
}
#endif
default:
snprintf(typbuff, typlen, "IPV6.%u", cmsg->cmsg_type);