gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r36056 - gnunet/src/nat


From: gnunet
Subject: [GNUnet-SVN] r36056 - gnunet/src/nat
Date: Tue, 7 Jul 2015 23:45:31 +0200

Author: grothoff
Date: 2015-07-07 23:45:31 +0200 (Tue, 07 Jul 2015)
New Revision: 36056

Modified:
   gnunet/src/nat/nat.c
Log:
slightly nicer ifname cmp

Modified: gnunet/src/nat/nat.c
===================================================================
--- gnunet/src/nat/nat.c        2015-07-07 21:41:29 UTC (rev 36055)
+++ gnunet/src/nat/nat.c        2015-07-07 21:45:31 UTC (rev 36056)
@@ -651,6 +651,13 @@
 
 
 /**
+ * Length of the interface names returned from os_network.c.
+ * (in that file, hardcoded at 11).
+ */
+#define IF_NAME_LEN 11
+
+
+/**
  * Add the IP of our network interface to the list of
  * our IP addresses.
  *
@@ -689,8 +696,9 @@
                                              "IFNAME",
                                              &tun_if))
   {
-    if (0 == strcmp (name,
-                     tun_if))
+    if (0 == strncasecmp (name,
+                          tun_if,
+                          IF_NAME_LEN))
     {
       GNUNET_free (tun_if);
       return GNUNET_OK;
@@ -703,8 +711,9 @@
                                              "IFNAME",
                                              &tun_if))
   {
-    if (0 == strcmp (name,
-                     tun_if))
+    if (0 == strncasecmp (name,
+                          tun_if,
+                          IF_NAME_LEN))
     {
       GNUNET_free (tun_if);
       return GNUNET_OK;
@@ -717,8 +726,9 @@
                                              "EXIT_IFNAME",
                                              &tun_if))
   {
-    if (0 == strcmp (name,
-                     tun_if))
+    if (0 == strncasecmp (name,
+                          tun_if,
+                          IF_NAME_LEN))
     {
       GNUNET_free (tun_if);
       return GNUNET_OK;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]