Fix unitialized warning
authorJoseph C. Lehner <joseph.c.lehner@gmail.com>
Tue, 9 Aug 2016 15:20:24 +0000 (17:20 +0200)
committerJoseph C. Lehner <joseph.c.lehner@gmail.com>
Tue, 9 Aug 2016 15:20:24 +0000 (17:20 +0200)
nmrp.c

diff --git a/nmrp.c b/nmrp.c
index 39d37f96d7dbe13aadad741f1f83adbd69da0ebb..6ed8c55a83d0d825a722c9b0bcda7b49233d664f 100644 (file)
--- a/nmrp.c
+++ b/nmrp.c
@@ -462,7 +462,11 @@ int nmrp_do(struct nmrpd_args *args)
                return 1;
        }
 
-       status = is_valid_ip(sock, &ipaddr, &ipmask);
+       gsock = sock;
+       garp = 0;
+       sigh_orig = signal(SIGINT, sigh);
+
+       status = is_valid_ip(sock, &ipconf.addr, &ipconf.mask);
        if (status <= 0) {
                if (!status) {
                        fprintf(stderr, "Address %s/%s cannot be used on interface %s.\n",
@@ -471,10 +475,6 @@ int nmrp_do(struct nmrpd_args *args)
                goto out;
        }
 
-       gsock = sock;
-       garp = 0;
-       sigh_orig = signal(SIGINT, sigh);
-
        if (ethsock_set_timeout(sock, args->rx_timeout)) {
                goto out;
        }