]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
ipaddrlabel: use uint32_t instead of int32_t
authorHangbin Liu <liuhangbin@gmail.com>
Tue, 19 Nov 2013 15:46:20 +0000 (23:46 +0800)
committerStephen Hemminger <stephen@networkplumber.org>
Sat, 23 Nov 2013 01:03:15 +0000 (17:03 -0800)
As both linux kernel and function ipaddrlabel_modify use unsigned int for
label. We should also use unsigned int value when print addrlabel in case of
misunderstanding.

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
ip/ipaddrlabel.c

index 1789d9c18eac3df92f3df19272c5b48eb80726d8..68a94ddf43e6a8833cd8b517f7aa05984987c2ab 100644 (file)
@@ -86,10 +86,10 @@ int print_addrlabel(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg
        if (ifal->ifal_index)
                fprintf(fp, "dev %s ", ll_index_to_name(ifal->ifal_index));
 
-       if (tb[IFAL_LABEL] && RTA_PAYLOAD(tb[IFAL_LABEL]) == sizeof(int32_t)) {
-               int32_t label;
+       if (tb[IFAL_LABEL] && RTA_PAYLOAD(tb[IFAL_LABEL]) == sizeof(uint32_t)) {
+               uint32_t label;
                memcpy(&label, RTA_DATA(tb[IFAL_LABEL]), sizeof(label));
-               fprintf(fp, "label %d ", label);
+               fprintf(fp, "label %u ", label);
        }
 
        fprintf(fp, "\n");