]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
ip-addrlabel: Fix printing of label value
authorPhil Sutter <phil@nwl.cc>
Mon, 15 Oct 2018 20:20:58 +0000 (22:20 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Tue, 16 Oct 2018 18:51:05 +0000 (11:51 -0700)
Passing the return value of RTA_DATA() to rta_getattr_u32() is wrong
since that function will call RTA_DATA() by itself already.

Fixes: a7ad1c8a6845d ("ipaddrlabel: add json support")
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
ip/ipaddrlabel.c

index 2f79c56dcead29e41c8bff2dbf9e977c779083cc..8abe5722bafd169009d6a0819be0b6799a37cd20 100644 (file)
@@ -95,7 +95,7 @@ int print_addrlabel(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg
        }
 
        if (tb[IFAL_LABEL] && RTA_PAYLOAD(tb[IFAL_LABEL]) == sizeof(uint32_t)) {
-               uint32_t label = rta_getattr_u32(RTA_DATA(tb[IFAL_LABEL]));
+               uint32_t label = rta_getattr_u32(tb[IFAL_LABEL]);
 
                print_uint(PRINT_ANY,
                           "label", "label %u ", label);