]> git.proxmox.com Git - mirror_iproute2.git/blobdiff - tc/em_u32.c
rdma: Properly mark RDMAtool license
[mirror_iproute2.git] / tc / em_u32.c
index 21ed70fd9b02742b226457c91f0d38bf7d1bd442..bc284af4f0dca83715a3d6a613d9ead982d3c418 100644 (file)
@@ -12,7 +12,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
 #include <fcntl.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
@@ -39,12 +38,10 @@ static int u32_parse_eopt(struct nlmsghdr *n, struct tcf_ematch_hdr *hdr,
        struct bstr *a;
        int align, nh_len;
        unsigned long key, mask, offmask = 0, offset;
-       struct tc_u32_key u_key;
-
-       memset(&u_key, 0, sizeof(u_key));
+       struct tc_u32_key u_key = {};
 
 #define PARSE_ERR(CARG, FMT, ARGS...) \
-       em_parse_error(EINVAL, args, CARG, &u32_ematch_util, FMT ,##ARGS)
+       em_parse_error(EINVAL, args, CARG, &u32_ematch_util, FMT##ARGS)
 
        if (args == NULL)
                return PARSE_ERR(args, "u32: missing arguments");
@@ -85,6 +82,7 @@ static int u32_parse_eopt(struct nlmsghdr *n, struct tcf_ematch_hdr *hdr,
        nh_len = strlen("nexthdr+");
        if (a->len > nh_len && !memcmp(a->data, "nexthdr+", nh_len)) {
                char buf[a->len - nh_len + 1];
+
                offmask = -1;
                memcpy(buf, a->data + nh_len, a->len - nh_len);
                offset = strtoul(buf, NULL, 0);