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

@ -60,6 +60,9 @@ corrections:
Ignore exit code of child process when it was killed by master due to Ignore exit code of child process when it was killed by master due to
EOF EOF
Corrected byte order on read of IPV6_TCLASS value from ancillary
message
porting: porting:
Type conflict between int and sig_atomic_t between declaration and Type conflict between int and sig_atomic_t between declaration and
definition of diag_immediate_type and diag_immediate_exit broke definition of diag_immediate_type and diag_immediate_exit broke

View file

@ -292,11 +292,14 @@ int xiolog_ancillary_ip6(struct cmsghdr *cmsg, int *num,
return STAT_OK; return STAT_OK;
#endif #endif
#ifdef IPV6_TCLASS #ifdef IPV6_TCLASS
case IPV6_TCLASS: case IPV6_TCLASS: {
unsigned int u;
typbuff[0] = '\0'; strncat(typbuff, "IPV6_TCLASS", typlen-1); typbuff[0] = '\0'; strncat(typbuff, "IPV6_TCLASS", typlen-1);
nambuff[0] = '\0'; strncat(nambuff, "tclass", namlen-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; return STAT_OK;
}
#endif #endif
default: default:
snprintf(typbuff, typlen, "IPV6.%u", cmsg->cmsg_type); snprintf(typbuff, typlen, "IPV6.%u", cmsg->cmsg_type);