Use iface instead of interface because it might already be declared in
authorGuus Sliepen <guus@tinc-vpn.org>
Fri, 18 Jul 2003 13:45:06 +0000 (13:45 +0000)
committerGuus Sliepen <guus@tinc-vpn.org>
Fri, 18 Jul 2003 13:45:06 +0000 (13:45 +0000)
system header files.

src/device.h
src/graph.c
src/net_setup.c
src/net_socket.c

index 4982cba..4dce250 100644 (file)
@@ -17,7 +17,7 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
     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__
 */
 
 #ifndef __TINC_DEVICE_H__
 extern int device_fd;
 extern char *device;
 
 extern int device_fd;
 extern char *device;
 
-#ifdef HAVE_CYGWIN
 extern char *iface;
 extern char *iface;
-#define interface iface
-#else
-extern char *interface;
-#endif
 
 extern int setup_device(void);
 extern void close_device(void);
 
 extern int setup_device(void);
 extern void close_device(void);
index 2c6ad22..147586e 100644 (file)
@@ -17,7 +17,7 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
     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:
 */
 
 /* 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[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);
                        asprintf(&envp[3], "NODE=%s", n->name);
                        sockaddr2str(&n->address, &address, &port);
                        asprintf(&envp[4], "REMOTEADDRESS=%s", address);
index ca7aa61..b3c565b 100644 (file)
@@ -17,7 +17,7 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
     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"
 */
 
 #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 ? : "");
        /* 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;
 
        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[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;
 
        asprintf(&envp[3], "NAME=%s", myself->name);
        envp[4] = NULL;
 
index 90458d2..82875bb 100644 (file)
@@ -17,7 +17,7 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
     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"
 */
 
 #include "system.h"
@@ -48,7 +48,7 @@ int setup_listen_socket(sockaddr_t *sa)
        int nfd, flags;
        char *addrstr;
        int option;
        int nfd, flags;
        char *addrstr;
        int option;
-       char *interface;
+       char *iface;
        struct ifreq ifr;
 
        cp();
        struct ifreq ifr;
 
        cp();
@@ -84,14 +84,14 @@ int setup_listen_socket(sockaddr_t *sa)
 #endif
 
        if(get_config_string
 #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));
 #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);
 
                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;
                }
                                   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 *addrstr;
        int option;
 #if defined(SOL_SOCKET) && defined(SO_BINDTODEVICE)
-       char *interface;
+       char *iface;
        struct ifreq ifr;
 #endif
 
        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
 
 #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));
                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);
 
                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;
                }
                                   strerror(errno));
                        return -1;
                }