]> git.proxmox.com Git - mirror_iproute2.git/blobdiff - tc/em_meta.c
tc: m_action: check cookie hex string len
[mirror_iproute2.git] / tc / em_meta.c
index bf47093799f4d0d58ca9660f3eabbe1a3921af64..2ddc65ed6cb6b42b1d04cc6998dd7f9b43190800 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,7 +38,7 @@ static void meta_print_usage(FILE *fd)
            "For a list of meta identifiers, use meta(list).\n");
 }
 
-struct meta_entry {
+static const struct meta_entry {
        int             id;
        char *kind;
        char *mask;
@@ -122,7 +121,7 @@ static inline int map_type(char k)
        return INT_MAX;
 }
 
-static struct meta_entry *lookup_meta_entry(struct bstr *kind)
+static const struct meta_entry *lookup_meta_entry(struct bstr *kind)
 {
        int i;
 
@@ -134,7 +133,7 @@ static struct meta_entry *lookup_meta_entry(struct bstr *kind)
        return NULL;
 }
 
-static struct meta_entry *lookup_meta_entry_byid(int id)
+static const struct meta_entry *lookup_meta_entry_byid(int id)
 {
        int i;
 
@@ -169,8 +168,8 @@ static inline void dump_value(struct nlmsghdr *n, int tlv, unsigned long val,
 static inline int is_compatible(struct tcf_meta_val *what,
                                struct tcf_meta_val *needed)
 {
+       const struct meta_entry *entry;
        char *p;
-       struct meta_entry *entry;
 
        entry = lookup_meta_entry_byid(TCF_META_ID(what->kind));
 
@@ -250,7 +249,7 @@ static inline struct bstr *
 parse_object(struct bstr *args, struct bstr *arg, struct tcf_meta_val *obj,
             unsigned long *dst, struct tcf_meta_val *left)
 {
-       struct meta_entry *entry;
+       const struct meta_entry *entry;
        unsigned long num;
        struct bstr *a;
 
@@ -462,7 +461,7 @@ static int print_object(FILE *fd, struct tcf_meta_val *obj, struct rtattr *rta)
 {
        int id = TCF_META_ID(obj->kind);
        int type = TCF_META_TYPE(obj->kind);
-       struct meta_entry *entry;
+       const struct meta_entry *entry;
 
        if (id == TCF_META_ID_VALUE)
                return print_value(fd, type, rta);