chiark / gitweb /
Accept unquoted cookie paths, even though they are formally illegal.
[disorder] / lib / addr.c
index f1f1c217bf8676c596c0cda7287ba0a0a6f04d7b..a7633219853043c6d03443052578b4dd31ed2f31 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * This file is part of DisOrder.
- * Copyright (C) 2004 Richard Kettlewell
+ * Copyright (C) 2004, 2007 Richard Kettlewell
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -17,7 +17,8 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
  * USA
  */
-/** @file lib/addr.c Socket address support */
+/** @file lib/addr.c
+ * @brief Socket address support */
 
 #include <config.h>
 #include "types.h"
@@ -124,8 +125,8 @@ int addrinfocmp(const struct addrinfo *a,
   }
 }
 
-static inline int multicast4(const struct sockaddr_in *sin) {
-  return IN_MULTICAST(ntohl(sin->sin_addr.s_addr));
+static inline int multicast4(const struct sockaddr_in *sin4) {
+  return IN_MULTICAST(ntohl(sin4->sin_addr.s_addr));
 }
 
 static inline int multicast6(const struct sockaddr_in6 *sin6) {
@@ -144,17 +145,17 @@ int multicast(const struct sockaddr *sa) {
   }
 }
 
-static inline char *format_sockaddr4(const struct sockaddr_in *sin) {
+static inline char *format_sockaddr4(const struct sockaddr_in *sin4) {
   char buffer[1024], *r;
 
-  if(sin->sin_port)
+  if(sin4->sin_port)
     byte_xasprintf(&r, "%s port %u",
-                  inet_ntop(sin->sin_family, &sin->sin_addr,
+                  inet_ntop(sin4->sin_family, &sin4->sin_addr,
                             buffer, sizeof buffer),
-                  ntohs(sin->sin_port));
+                  ntohs(sin4->sin_port));
   else
     byte_xasprintf(&r, "%s",
-                  inet_ntop(sin->sin_family, &sin->sin_addr,
+                  inet_ntop(sin4->sin_family, &sin4->sin_addr,
                             buffer, sizeof buffer));
   return r;
 }