diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-07-07 21:45:31 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-07-07 21:45:31 +0000 |
commit | 7a57a3e01b6501ab208c18fe6762de8752d6c358 (patch) | |
tree | 12d33c8a45b82bb30ed0ff175844d2144256d40d /src/nat/nat.c | |
parent | 3d1b8b823e1d10ebcf94e02868c6e24b762a07fc (diff) | |
download | gnunet-7a57a3e01b6501ab208c18fe6762de8752d6c358.tar.gz gnunet-7a57a3e01b6501ab208c18fe6762de8752d6c358.zip |
slightly nicer ifname cmp
Diffstat (limited to 'src/nat/nat.c')
-rw-r--r-- | src/nat/nat.c | 22 |
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, | |||
651 | 651 | ||
652 | 652 | ||
653 | /** | 653 | /** |
654 | * Length of the interface names returned from os_network.c. | ||
655 | * (in that file, hardcoded at 11). | ||
656 | */ | ||
657 | #define IF_NAME_LEN 11 | ||
658 | |||
659 | |||
660 | /** | ||
654 | * Add the IP of our network interface to the list of | 661 | * Add the IP of our network interface to the list of |
655 | * our IP addresses. | 662 | * our IP addresses. |
656 | * | 663 | * |
@@ -689,8 +696,9 @@ process_interfaces (void *cls, | |||
689 | "IFNAME", | 696 | "IFNAME", |
690 | &tun_if)) | 697 | &tun_if)) |
691 | { | 698 | { |
692 | if (0 == strcmp (name, | 699 | if (0 == strncasecmp (name, |
693 | tun_if)) | 700 | tun_if, |
701 | IF_NAME_LEN)) | ||
694 | { | 702 | { |
695 | GNUNET_free (tun_if); | 703 | GNUNET_free (tun_if); |
696 | return GNUNET_OK; | 704 | return GNUNET_OK; |
@@ -703,8 +711,9 @@ process_interfaces (void *cls, | |||
703 | "IFNAME", | 711 | "IFNAME", |
704 | &tun_if)) | 712 | &tun_if)) |
705 | { | 713 | { |
706 | if (0 == strcmp (name, | 714 | if (0 == strncasecmp (name, |
707 | tun_if)) | 715 | tun_if, |
716 | IF_NAME_LEN)) | ||
708 | { | 717 | { |
709 | GNUNET_free (tun_if); | 718 | GNUNET_free (tun_if); |
710 | return GNUNET_OK; | 719 | return GNUNET_OK; |
@@ -717,8 +726,9 @@ process_interfaces (void *cls, | |||
717 | "EXIT_IFNAME", | 726 | "EXIT_IFNAME", |
718 | &tun_if)) | 727 | &tun_if)) |
719 | { | 728 | { |
720 | if (0 == strcmp (name, | 729 | if (0 == strncasecmp (name, |
721 | tun_if)) | 730 | tun_if, |
731 | IF_NAME_LEN)) | ||
722 | { | 732 | { |
723 | GNUNET_free (tun_if); | 733 | GNUNET_free (tun_if); |
724 | return GNUNET_OK; | 734 | return GNUNET_OK; |