]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
ip fou: pass family attribute as u8
authorFilip Moc <dev@moc6.cz>
Sun, 7 Jan 2018 14:28:13 +0000 (15:28 +0100)
committerStephen Hemminger <stephen@networkplumber.org>
Tue, 9 Jan 2018 15:58:37 +0000 (07:58 -0800)
This fixes fou on big-endian systems.

Signed-off-by: Filip Moc <dev@moc6.cz>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
ip/ipfou.c

index febc2c8c402e136285dbeddb7624c76cd75b2935..1f392adea29d5c3894e269f0d4138a629818c5c2 100644 (file)
@@ -52,7 +52,7 @@ static int fou_parse_opt(int argc, char **argv, struct nlmsghdr *n,
        __u8 ipproto, type;
        bool gue_set = false;
        int ipproto_set = 0;
-       unsigned short family = AF_INET;
+       __u8 family = AF_INET;
 
        while (argc > 0) {
                if (!matches(*argv, "port")) {
@@ -103,7 +103,7 @@ static int fou_parse_opt(int argc, char **argv, struct nlmsghdr *n,
 
        addattr16(n, 1024, FOU_ATTR_PORT, port);
        addattr8(n, 1024, FOU_ATTR_TYPE, type);
-       addattr16(n, 1024, FOU_ATTR_AF, family);
+       addattr8(n, 1024, FOU_ATTR_AF, family);
 
        if (ipproto_set)
                addattr8(n, 1024, FOU_ATTR_IPPROTO, ipproto);