https://scan7.coverity.com:8443/reports.htm#v10205/p10016/fileInstanceId=8803&defectInstanceId=3705&mergedDefectId=591292&eventIds=3705-36&eventId=3705-36
see http://silviocesare.wordpress.com/2007/10/22/setting-sin_zero-to-0-in-struct-sockaddr_in/
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
if (inet_pton(AF_INET, src_addr, &src_sa4.sin_addr) > 0) {
src_sa4.sin_family = af = AF_INET;
src_sa4.sin_port = htons(0);
if (inet_pton(AF_INET, src_addr, &src_sa4.sin_addr) > 0) {
src_sa4.sin_family = af = AF_INET;
src_sa4.sin_port = htons(0);
+ memset(&src_sa4.sin_zero, 0, sizeof(src_sa4.sin_zero));
src_sap_sa4 = src_sa4;
#ifdef HAVE_IPV6
} else if (inet_pton(AF_INET6, src_addr, &src_sa6.sin6_addr) > 0) {
src_sa6.sin6_family = af = AF_INET6;
src_sa6.sin6_port = htons(0);
src_sap_sa4 = src_sa4;
#ifdef HAVE_IPV6
} else if (inet_pton(AF_INET6, src_addr, &src_sa6.sin6_addr) > 0) {
src_sa6.sin6_family = af = AF_INET6;
src_sa6.sin6_port = htons(0);
+ src_sa6.sin6_flowinfo = 0;
+ src_sa6.sin6_scope_id = 0;
src_sap_sa6 = src_sa6;
#endif
} else {
src_sap_sa6 = src_sa6;
#endif
} else {
if (inet_pton(AF_INET, dst_addr, &dst_sa4.sin_addr) > 0) {
dst_sa4.sin_family = af = AF_INET;
dst_sa4.sin_port = htons((uint16_t) port);
if (inet_pton(AF_INET, dst_addr, &dst_sa4.sin_addr) > 0) {
dst_sa4.sin_family = af = AF_INET;
dst_sa4.sin_port = htons((uint16_t) port);
+ memset(&dst_sa4.sin_zero, 0, sizeof(dst_sa4.sin_zero));
dst_sap_sa4 = dst_sa4;
dst_sap_sa4.sin_port = htons(SAP_PORT);
#ifdef HAVE_IPV6
} else if (inet_pton(AF_INET6, dst_addr, &dst_sa6.sin6_addr) > 0) {
dst_sa6.sin6_family = af = AF_INET6;
dst_sa6.sin6_port = htons((uint16_t) port);
dst_sap_sa4 = dst_sa4;
dst_sap_sa4.sin_port = htons(SAP_PORT);
#ifdef HAVE_IPV6
} else if (inet_pton(AF_INET6, dst_addr, &dst_sa6.sin6_addr) > 0) {
dst_sa6.sin6_family = af = AF_INET6;
dst_sa6.sin6_port = htons((uint16_t) port);
+ dst_sa6.sin6_flowinfo = 0;
+ src_sa6.sin6_scope_id = 0;
dst_sap_sa6 = dst_sa6;
dst_sap_sa6.sin6_port = htons(SAP_PORT);
#endif
dst_sap_sa6 = dst_sa6;
dst_sap_sa6.sin6_port = htons(SAP_PORT);
#endif