]> git.proxmox.com Git - mirror_iproute2.git/blobdiff - tc/em_cmp.c
Unify batch processing across tools
[mirror_iproute2.git] / tc / em_cmp.c
index ce72a42918e376207032912fb570ae41d3be28d4..e051656f0bbb7f82ba27162f85d59a87b4606cfb 100644 (file)
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
 #include <fcntl.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <string.h>
-#include <dlfcn.h>
 #include <errno.h>
 
 #include "m_ematch.h"
@@ -45,12 +43,10 @@ static int cmp_parse_eopt(struct nlmsghdr *n, struct tcf_ematch_hdr *hdr,
        int align, opnd = 0;
        unsigned long offset = 0, layer = TCF_LAYER_NETWORK, mask = 0, value = 0;
        int offset_present = 0, value_present = 0;
-       struct tcf_em_cmp cmp;
-
-       memset(&cmp, 0, sizeof(cmp));
+       struct tcf_em_cmp cmp = {};
 
 #define PARSE_ERR(CARG, FMT, ARGS...) \
-       em_parse_error(EINVAL, args, CARG, &cmp_ematch_util, FMT ,##ARGS)
+       em_parse_error(EINVAL, args, CARG, &cmp_ematch_util, FMT##ARGS)
 
        if (args == NULL)
                return PARSE_ERR(args, "cmp: missing arguments");
@@ -156,7 +152,7 @@ static int cmp_print_eopt(FILE *fd, struct tcf_ematch_hdr *hdr, void *data,
                fprintf(fd, "u8 ");
        else if (cmp->align == TCF_EM_ALIGN_U16)
                fprintf(fd, "u16 ");
-       else if (cmp->align == TCF_EM_ALIGN_U16)
+       else if (cmp->align == TCF_EM_ALIGN_U32)
                fprintf(fd, "u32 ");
 
        fprintf(fd, "at %d layer %d ", cmp->off, cmp->layer);