INN commit: trunk (3 files)
INN Commit
rra at isc.org
Tue Jul 7 16:34:36 UTC 2015
Date: Tuesday, July 7, 2015 @ 09:34:36
Author: iulius
Revision: 9914
Remove unneeded UNUSED from network support functions
Patch from upstream rra-c-util package.
Also homogenize our local network-innbind library with
the upstream network one.
Modified:
trunk/include/inn/network-innbind.h
trunk/lib/network-innbind.c
trunk/lib/network.c
-------------------------------+
include/inn/network-innbind.h | 32 ++++----------------------------
lib/network-innbind.c | 12 ++++++++++--
lib/network.c | 6 +++---
3 files changed, 17 insertions(+), 33 deletions(-)
Modified: include/inn/network-innbind.h
===================================================================
--- include/inn/network-innbind.h 2015-07-07 16:31:52 UTC (rev 9913)
+++ include/inn/network-innbind.h 2015-07-07 16:34:36 UTC (rev 9914)
@@ -2,31 +2,7 @@
*
* Prototypes for network connection utility functions using innbind.
*
- * The canonical version of this file is maintained in the rra-c-util package,
- * which can be found at <http://www.eyrie.org/~eagle/software/rra-c-util/>.
- *
- * Written by Russ Allbery <eagle at eyrie.org>
- * Copyright 2009, 2010, 2011, 2012, 2013
- * The Board of Trustees of the Leland Stanford Junior University
- * Copyright (c) 2004, 2005, 2006, 2007, 2008, 2010
- * by Internet Systems Consortium, Inc. ("ISC")
- * Copyright (c) 1991, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
- * 2002, 2003 by The Internet Software Consortium and Rich Salz
- *
- * This code is derived from software contributed to the Internet Software
- * Consortium by Rich Salz.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
- * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
+ * This file is heavily based on include/inn/network.h.
*/
#ifndef INN_NETWORK_INNBIND_H
@@ -43,9 +19,9 @@
/*
* Create a socket of the given type and bind it to the specified address and
- * port (either IPv4 or IPv6), returning the resulting file descriptor or -1
- * on error. Errors are reported using warn/syswarn. To bind to all
- * interfaces, use "any" or "all" for address.
+ * port (either IPv4 or IPv6), returning the resulting file descriptor or
+ * INVALID_SOCKET on error. Errors are reported using warn/syswarn. To bind
+ * to all interfaces, use "any" or "all" for address.
*/
socket_type network_innbind_ipv4(int type, const char *addr, unsigned short port)
__attribute__((__nonnull__));
Modified: lib/network-innbind.c
===================================================================
--- lib/network-innbind.c 2015-07-07 16:31:52 UTC (rev 9913)
+++ lib/network-innbind.c 2015-07-07 16:34:36 UTC (rev 9914)
@@ -70,7 +70,7 @@
* consistent and easier to understand.
*/
#ifdef IPV6_V6ONLY
-static void UNUSED
+static void
network_set_v6only(socket_type fd)
{
int flag = 1;
@@ -86,7 +86,7 @@
* IPv6 addresses that may not have been set up yet.
*/
#ifdef IP_FREEBIND
-static void UNUSED
+static void
network_set_freebind(socket_type fd)
{
int flag = 1;
@@ -260,6 +260,7 @@
* kernel doesn't support it.
*/
#if HAVE_INET6
+
socket_type
network_innbind_ipv6(int type, const char *address, unsigned short port)
{
@@ -314,7 +315,9 @@
socket_close(fd);
return bindfd;
}
+
#else /* HAVE_INET6 */
+
socket_type
network_innbind_ipv6(int type UNUSED, const char *address, unsigned short port)
{
@@ -322,6 +325,7 @@
socket_set_errno(EPROTONOSUPPORT);
return INVALID_SOCKET;
}
+
#endif /* HAVE_INET6 */
@@ -333,6 +337,7 @@
* to hold the file descriptors and stores the count in the fourth argument.
*/
#if HAVE_INET6
+
bool
network_innbind_all(int type, unsigned short port, socket_type **fds,
unsigned int *count)
@@ -394,7 +399,9 @@
freeaddrinfo(addrs);
return (*count > 0);
}
+
#else /* HAVE_INET6 */
+
bool
network_innbind_all(int type, unsigned short port, socket_type **fds,
unsigned int *count)
@@ -417,4 +424,5 @@
*count = 1;
return true;
}
+
#endif /* HAVE_INET6 */
Modified: lib/network.c
===================================================================
--- lib/network.c 2015-07-07 16:31:52 UTC (rev 9913)
+++ lib/network.c 2015-07-07 16:34:36 UTC (rev 9914)
@@ -21,7 +21,7 @@
* which can be found at <http://www.eyrie.org/~eagle/software/rra-c-util/>.
*
* Written by Russ Allbery <eagle at eyrie.org>
- * Copyright 2014 Russ Allbery <eagle at eyrie.org>
+ * Copyright 2014, 2015 Russ Allbery <eagle at eyrie.org>
* Copyright 2009, 2011, 2012, 2013, 2014
* The Board of Trustees of the Leland Stanford Junior University
* Copyright (c) 2004, 2005, 2006, 2007, 2008
@@ -122,7 +122,7 @@
* consistent and easier to understand.
*/
#ifdef IPV6_V6ONLY
-static void UNUSED
+static void
network_set_v6only(socket_type fd)
{
int flag = 1;
@@ -138,7 +138,7 @@
* IPv6 addresses that may not have been set up yet.
*/
#ifdef IP_FREEBIND
-static void UNUSED
+static void
network_set_freebind(socket_type fd)
{
int flag = 1;
More information about the inn-committers
mailing list