From 123bb765d10453fdccbe363a02e3042c588729cc Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Fri, 18 Jul 2003 13:45:06 +0000 Subject: [PATCH 1/1] Use iface instead of interface because it might already be declared in system header files. --- src/device.h | 7 +------ src/graph.c | 4 ++-- src/net_setup.c | 6 +++--- src/net_socket.c | 18 +++++++++--------- 4 files changed, 15 insertions(+), 20 deletions(-) diff --git a/src/device.h b/src/device.h index 4982cba..4dce250 100644 --- a/src/device.h +++ b/src/device.h @@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id: device.h,v 1.1.2.9 2003/07/15 16:38:18 guus Exp $ + $Id: device.h,v 1.1.2.10 2003/07/18 13:45:06 guus Exp $ */ #ifndef __TINC_DEVICE_H__ @@ -26,12 +26,7 @@ extern int device_fd; extern char *device; -#ifdef HAVE_CYGWIN extern char *iface; -#define interface iface -#else -extern char *interface; -#endif extern int setup_device(void); extern void close_device(void); diff --git a/src/graph.c b/src/graph.c index 2c6ad22..147586e 100644 --- a/src/graph.c +++ b/src/graph.c @@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id: graph.c,v 1.1.2.25 2003/07/17 15:06:26 guus Exp $ + $Id: graph.c,v 1.1.2.26 2003/07/18 13:45:06 guus Exp $ */ /* We need to generate two trees from the graph: @@ -262,7 +262,7 @@ void sssp_bfs(void) asprintf(&envp[0], "NETNAME=%s", netname ? : ""); asprintf(&envp[1], "DEVICE=%s", device ? : ""); - asprintf(&envp[2], "INTERFACE=%s", interface ? : ""); + asprintf(&envp[2], "INTERFACE=%s", iface ? : ""); asprintf(&envp[3], "NODE=%s", n->name); sockaddr2str(&n->address, &address, &port); asprintf(&envp[4], "REMOTEADDRESS=%s", address); diff --git a/src/net_setup.c b/src/net_setup.c index ca7aa61..b3c565b 100644 --- a/src/net_setup.c +++ b/src/net_setup.c @@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id: net_setup.c,v 1.1.2.35 2003/07/17 15:06:26 guus Exp $ + $Id: net_setup.c,v 1.1.2.36 2003/07/18 13:45:06 guus Exp $ */ #include "system.h" @@ -525,7 +525,7 @@ int setup_network_connections(void) /* Run tinc-up script to further initialize the tap interface */ asprintf(&envp[0], "NETNAME=%s", netname ? : ""); asprintf(&envp[1], "DEVICE=%s", device ? : ""); - asprintf(&envp[2], "INTERFACE=%s", interface ? : ""); + asprintf(&envp[2], "INTERFACE=%s", iface ? : ""); asprintf(&envp[3], "NAME=%s", myself->name); envp[4] = NULL; @@ -577,7 +577,7 @@ void close_network_connections(void) asprintf(&envp[0], "NETNAME=%s", netname ? : ""); asprintf(&envp[1], "DEVICE=%s", device ? : ""); - asprintf(&envp[2], "INTERFACE=%s", interface ? : ""); + asprintf(&envp[2], "INTERFACE=%s", iface ? : ""); asprintf(&envp[3], "NAME=%s", myself->name); envp[4] = NULL; diff --git a/src/net_socket.c b/src/net_socket.c index 90458d2..82875bb 100644 --- a/src/net_socket.c +++ b/src/net_socket.c @@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id: net_socket.c,v 1.1.2.28 2003/07/18 13:41:35 guus Exp $ + $Id: net_socket.c,v 1.1.2.29 2003/07/18 13:45:06 guus Exp $ */ #include "system.h" @@ -48,7 +48,7 @@ int setup_listen_socket(sockaddr_t *sa) int nfd, flags; char *addrstr; int option; - char *interface; + char *iface; struct ifreq ifr; cp(); @@ -84,14 +84,14 @@ int setup_listen_socket(sockaddr_t *sa) #endif if(get_config_string - (lookup_config(config_tree, "BindToInterface"), &interface)) { + (lookup_config(config_tree, "BindToInterface"), &iface)) { #if defined(SOL_SOCKET) && defined(SO_BINDTODEVICE) memset(&ifr, 0, sizeof(ifr)); - strncpy(ifr.ifr_ifrn.ifrn_name, interface, IFNAMSIZ); + strncpy(ifr.ifr_ifrn.ifrn_name, iface, IFNAMSIZ); if(setsockopt(nfd, SOL_SOCKET, SO_BINDTODEVICE, &ifr, sizeof(ifr))) { close(nfd); - logger(LOG_ERR, _("Can't bind to interface %s: %s"), interface, + logger(LOG_ERR, _("Can't bind to interface %s: %s"), iface, strerror(errno)); return -1; } @@ -125,7 +125,7 @@ int setup_vpn_in_socket(sockaddr_t *sa) char *addrstr; int option; #if defined(SOL_SOCKET) && defined(SO_BINDTODEVICE) - char *interface; + char *iface; struct ifreq ifr; #endif @@ -151,13 +151,13 @@ int setup_vpn_in_socket(sockaddr_t *sa) #if defined(SOL_SOCKET) && defined(SO_BINDTODEVICE) if(get_config_string - (lookup_config(config_tree, "BindToInterface"), &interface)) { + (lookup_config(config_tree, "BindToInterface"), &iface)) { memset(&ifr, 0, sizeof(ifr)); - strncpy(ifr.ifr_ifrn.ifrn_name, interface, IFNAMSIZ); + strncpy(ifr.ifr_ifrn.ifrn_name, iface, IFNAMSIZ); if(setsockopt(nfd, SOL_SOCKET, SO_BINDTODEVICE, &ifr, sizeof(ifr))) { close(nfd); - logger(LOG_ERR, _("Can't bind to interface %s: %s"), interface, + logger(LOG_ERR, _("Can't bind to interface %s: %s"), iface, strerror(errno)); return -1; } -- 2.25.1