Changeset fa8f439
- Timestamp:
- May 5, 2009, 1:43:48 PM (15 years ago)
- Branches:
- master, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- e1b136bf
- Parents:
- c0b1a40
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libfaim/ft.c
rdd0edbf rfa8f439 253 253 { 254 254 int acceptfd = 0; 255 struct sockaddraddr;255 union { struct sockaddr sa; struct sockaddr_in sin; } addr; 256 256 socklen_t addrlen = sizeof(addr); 257 257 int ret = 0; … … 260 260 int port; 261 261 262 if ((acceptfd = accept(cur->fd, &addr , &addrlen)) == -1)262 if ((acceptfd = accept(cur->fd, &addr.sa, &addrlen)) == -1) 263 263 return 0; /* not an error */ 264 264 265 if ( (addr.sa_family != AF_INET) && (addr.sa_family != AF_INET6)) { /* just in case IPv6 really is happening*/265 if (addr.sa.sa_family != AF_INET) { /* This code needs way more help to get IPv6 right. */ 266 266 close(acceptfd); 267 267 aim_conn_close(cur); … … 269 269 } 270 270 271 strncpy(ip, inet_ntoa( ((struct sockaddr_in *)&addr)->sin_addr), sizeof(ip));272 port = ntohs( ((struct sockaddr_in *)&addr)->sin_port);271 strncpy(ip, inet_ntoa(addr.sin.sin_addr), sizeof(ip)); 272 port = ntohs(addr.sin.sin_port); 273 273 274 274 if (!(newconn = aim_cloneconn(sess, cur))) {
Note: See TracChangeset
for help on using the changeset viewer.