Move var declaration for older C compilers.
[rsync.git] / clientname.c
index 159f223a22e1f4bd4642476331460676c01835eb..e5684f8ffb00d342e0685fbdd90f749c313f0f76 100644 (file)
@@ -3,11 +3,12 @@
  *
  * Copyright (C) 1992-2001 Andrew Tridgell <tridge@samba.org>
  * Copyright (C) 2001, 2002 Martin Pool <mbp@samba.org>
- * Copyright (C) 2002-2007 Wayne Davison
+ * Copyright (C) 2002-2009 Wayne Davison
  *
  * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,8 +16,7 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ * with this program; if not, visit the http://fsf.org website.
  */
 
 /*
@@ -108,6 +108,9 @@ char *client_name(int fd)
                struct addrinfo hint, *answer;
                int err;
 
+               if (strcmp(addr, "0.0.0.0") == 0)
+                       return name_buf;
+
                memset(&hint, 0, sizeof hint);
 
 #ifdef AI_NUMERICHOST
@@ -266,7 +269,7 @@ int compare_addrinfo_sockaddr(const struct addrinfo *ai,
 
                if (ai->ai_addrlen < sizeof (struct sockaddr_in6)) {
                        rprintf(FLOG, "%s: too short sockaddr_in6; length=%d\n",
-                               fn, ai->ai_addrlen);
+                               fn, (int)ai->ai_addrlen);
                        return 1;
                }