]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
Fix compile warning in get_addr_1
authorDavid Ahern <dsa@cumulusnetworks.com>
Tue, 13 Dec 2016 23:34:32 +0000 (15:34 -0800)
committerStephen Hemminger <stephen@networkplumber.org>
Thu, 15 Dec 2016 03:00:36 +0000 (19:00 -0800)
A recent cleanup causes a compile warning on Debian jessie:

    CC       utils.o
utils.c: In function ‘get_addr_1’:
utils.c:486:21: warning: passing argument 1 of ‘ll_addr_a2n’ from incompatible pointer type
   len = ll_addr_a2n(&addr->data, sizeof(addr->data), name);
                     ^
In file included from utils.c:34:0:
../include/rt_names.h:27:5: note: expected ‘char *’ but argument is of type ‘__u32 (*)[8]’
 int ll_addr_a2n(char *lladdr, int len, const char *arg);
     ^

Revert the removal of the typecast

Fixes: e1933b928125 ("utils: cleanup style")
Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
lib/utils.c

index 316b048abcfca0605ac8e6993d9e035525b9ab31..83c9d097c60828ff3de1670e14d61b06a9b2bc32 100644 (file)
@@ -483,7 +483,8 @@ int get_addr_1(inet_prefix *addr, const char *name, int family)
        if (family == AF_PACKET) {
                int len;
 
-               len = ll_addr_a2n(&addr->data, sizeof(addr->data), name);
+               len = ll_addr_a2n((char *) &addr->data, sizeof(addr->data),
+                                 name);
                if (len < 0)
                        return -1;