Browse code

- fixed freebsd listen on ipv6 & ipv4 bug

Andrei Pelinescu-Onciul authored on 09/09/2002 21:08:35
Showing 1 changed files
... ...
@@ -171,6 +171,7 @@ static inline int init_su( union sockaddr_union* su,
171 171
 							struct ip_addr* ip,
172 172
 							unsigned short   port ) 
173 173
 {
174
+	memset(su, 0, sizeof(union sockaddr_union));/*needed on freebsd*/
174 175
 	su->s.sa_family=ip->af;
175 176
 	switch(ip->af){
176 177
 #ifdef USE_IPV6
... ...
@@ -207,6 +208,7 @@ static inline int hostent2su( union sockaddr_union* su,
207 208
 								unsigned int idx,
208 209
 								unsigned short   port ) 
209 210
 {
211
+	memset(su, 0, sizeof(union sockaddr_union)); /*needed on freebsd*/
210 212
 	su->s.sa_family=he->h_addrtype;
211 213
 	switch(he->h_addrtype){
212 214
 #ifdef USE_IPV6