summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-07-07 21:45:31 +0000
committerChristian Grothoff <christian@grothoff.org>2015-07-07 21:45:31 +0000
commit7a57a3e01b6501ab208c18fe6762de8752d6c358 (patch)
tree12d33c8a45b82bb30ed0ff175844d2144256d40d
parent3d1b8b823e1d10ebcf94e02868c6e24b762a07fc (diff)
slightly nicer ifname cmp
-rw-r--r--src/nat/nat.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/nat/nat.c b/src/nat/nat.c
index 3fcfbd2f1..9eb7e7e7b 100644
--- a/src/nat/nat.c
+++ b/src/nat/nat.c
@@ -651,6 +651,13 @@ process_hostname_ip (void *cls,
/**
+ * 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 @@ process_interfaces (void *cls,
"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 @@ process_interfaces (void *cls,
"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 @@ process_interfaces (void *cls,
"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;