Przeglądaj źródła

Merge branch 'disable-ipv6-compile-fixes' into maint

* disable-ipv6-compile-fixes:
  * Use proper protocol lookup for socket when answering
  * Fix --disable-ipv6 compiling
Bryan Drewery 15 lat temu
rodzic
commit
62e2d2e202
2 zmienionych plików z 4 dodań i 6 usunięć
  1. 0 2
      src/match.c
  2. 4 4
      src/net.c

+ 0 - 2
src/match.c

@@ -288,9 +288,7 @@ match_cidr(const char *m, const char *a)
   *ip++ = '\0';
 
   int ret = 0;
-#ifdef USE_IPV6
   int aftype = 0;
-#endif
 
   sockname_t ipaddr, maskaddr;
   bzero(&ipaddr, sizeof(ipaddr));

+ 4 - 4
src/net.c

@@ -631,11 +631,11 @@ int open_telnet(const char *ip, port_t port, bool proxy, int identd)
  * 'addr' is ignored if af_def is AF_INET6 -poptix (02/03/03)
  */
 #ifdef USE_IPV6
-int open_address_listen(const char* ip, int af_def, port_t *port)
+int open_address_listen(const char* ip, int af_def, port_t *port) {
 #else
-int open_address_listen(const char* ip, port_t *port)
+int open_address_listen(const char* ip, port_t *port) {
+   int af_def = AF_INET;
 #endif /* USE_IPV6 */
- {
 //  if (firewall[0]) {
 //    /* FIXME: can't do listen port thru firewall yet */
 //    putlog(LOG_MISC, "*", "!! Cant open a listen port (you are using a firewall)");
@@ -804,8 +804,8 @@ int answer(int sock, char *caller, in_addr_t *ip, port_t *port, int binary)
   int new_sock;
   socklen_t addrlen;
   struct sockaddr_in from;
-#ifdef USE_IPV6
   int af_ty = sockprotocol(sock);
+#ifdef USE_IPV6
   struct sockaddr_in6 from6;
 
   bzero(&from6, sizeof(struct sockaddr_in6));