]> git.proxmox.com Git - mirror_iproute2.git/blobdiff - tc/em_meta.c
tc: Remove pointless assignments in batch()
[mirror_iproute2.git] / tc / em_meta.c
index 9ce5a78a628acc208f91396af9f2cffaa1214498..d94fe88d9b2f67edcb15983324bc06f8ac78a582 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>
@@ -361,11 +360,9 @@ static int meta_parse_eopt(struct nlmsghdr *n, struct tcf_ematch_hdr *hdr,
 {
        int opnd;
        struct bstr *a;
-       struct tcf_meta_hdr meta_hdr;
+       struct tcf_meta_hdr meta_hdr = {};
        unsigned long lvalue = 0, rvalue = 0;
 
-       memset(&meta_hdr, 0, sizeof(meta_hdr));
-
        if (args == NULL)
                return PARSE_ERR(args, "meta: missing arguments");
 
@@ -485,8 +482,9 @@ static int print_object(FILE *fd, struct tcf_meta_val *obj, struct rtattr *rta)
                                if (RTA_PAYLOAD(rta) < sizeof(__u32))
                                        goto size_mismatch;
 
-                               fprintf(fd, " mask 0x%08x",
-                                   rta_getattr_u32(rta));
+                               if (rta_getattr_u32(rta))
+                                       fprintf(fd, " mask 0x%08x",
+                                               rta_getattr_u32(rta));
                        }
                        break;
        }