--------------------- PatchSet 1354 Date: 2005/05/09 14:02:07 Author: rmartinez Branch: squid3-ipv6 Tag: (none) Log: Shorter Macros. AF_FAMILY either IPv6 or IPv4 according to compile mode. Module steady Members: src/comm.cc:1.47.2.4->1.47.2.5 Index: squid3/src/comm.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/comm.cc,v retrieving revision 1.47.2.4 retrieving revision 1.47.2.5 diff -u -r1.47.2.4 -r1.47.2.5 --- squid3/src/comm.cc 5 May 2005 09:19:38 -0000 1.47.2.4 +++ squid3/src/comm.cc 9 May 2005 14:02:07 -0000 1.47.2.5 @@ -1,6 +1,6 @@ /* - * $Id: comm.cc,v 1.47.2.4 2005/05/05 09:19:38 rmartinez Exp $ + * $Id: comm.cc,v 1.47.2.5 2005/05/09 14:02:07 rmartinez Exp $ * * DEBUG: section 5 Socket Functions * AUTHOR: Harvest Derived @@ -1021,7 +1021,7 @@ struct SOCKADDR_IN S; memset(&S, '\0', sizeof(S)); - FAMILY_FROM_SA(S) = AF_INET; + FAMILY_FROM_SA(S) = AF_FAMILY; PORT_FROM_SA(S) = htons(port); ADDR_FROM_SA(S) = in_addr; statCounter.syscalls.sock.binds++; @@ -1031,7 +1031,7 @@ debug(50, 0) ("commBind: Cannot bind socket FD %d to %s:%d: %s\n", s, - ADDR_IS_ANYADDR(ADDR_FROM_SA(S)) ? "*" : INET_NTOA(ADDR_FROM_SA(S)), + ADDR_IS_ANYADDR(ADDR_FROM_SA(S)) ? "*" : SA_NTOA(S), (int) port, xstrerror()); @@ -1078,7 +1078,7 @@ /* Create socket for accepting new connections. */ statCounter.syscalls.sock.sockets++; - if ((new_socket = socket(AF_INET, sock_type, proto)) < 0) + if ((new_socket = socket(AF_FAMILY, sock_type, proto)) < 0) { /* Increase the number of reserved fd's if calls to socket() * are failing because the open file table is full. This @@ -1297,7 +1297,7 @@ statCounter.syscalls.sock.sockets++; - int fd2 = socket(AF_INET, SOCK_STREAM, 0); + int fd2 = socket(AF_FAMILY, SOCK_STREAM, 0); if (fd2 < 0) { debug(5, 0) ("commResetFD: socket: %s\n", xstrerror()); @@ -1390,7 +1390,7 @@ void ConnectStateData::defaults() { - FAMILY_FROM_SA(S) = AF_INET; + FAMILY_FROM_SA(S) = AF_FAMILY; ADDR_FROM_SA(S) = in_addr; PORT_FROM_SA(S) = htons(port); } @@ -1581,7 +1581,7 @@ fdd_table[sock].close_line = 0; fdc_table[sock].active = 1; fde *F = &fd_table[sock]; - xstrncpy(F->ipaddr, INET_NTOA(ADDR_FROM_SA(details.peer)), 16); + xstrncpy(F->ipaddr, SA_NTOA(details.peer), 16); F->remote_port = htons(PORT_FROM_SA(details.peer)); F->local_port = htons(PORT_FROM_SA(details.me)); commSetNonBlocking(sock);