Fixed dead pointer problem when handling interfaces
[lcr.git] / gsm.cpp
diff --git a/gsm.cpp b/gsm.cpp
index 3f778b4..8e5a2d6 100644 (file)
--- a/gsm.cpp
+++ b/gsm.cpp
@@ -263,11 +263,7 @@ void gsm_trace_header(const char *interface_name, class Pgsm *port, unsigned int
        char msgtext[64];
        struct interface *interface = interface_first;
 
-       while (interface) {
-               if (!strcmp(interface->name, interface_name))
-                       break;
-               interface = interface->next;
-       }
+       interface = getinterfacebyname(interface_name);
        if (!interface)
                return;