]> git.proxmox.com Git - mirror_iproute2.git/blobdiff - tc/m_ife.c
rdma: Reduce scope of _dev_map_lookup call
[mirror_iproute2.git] / tc / m_ife.c
index e05e2276bd5ae3422b003c6896ed66d579c7a3f0..4647f6a6e779c4befef631e1e166ee2b37ec80fb 100644 (file)
@@ -13,7 +13,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
 #include <fcntl.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
@@ -93,7 +92,7 @@ static int parse_ife(struct action_util *a, int *argc_p, char ***argv_p,
                        } else if (matches(*argv, "prio") == 0) {
                                ife_prio = IFE_META_PRIO;
                        } else if (matches(*argv, "tcindex") == 0) {
-                               ife_prio = IFE_META_TCINDEX;
+                               ife_tcindex = IFE_META_TCINDEX;
                        } else {
                                fprintf(stderr, "Illegal meta define <%s>\n",
                                        *argv);
@@ -125,7 +124,7 @@ static int parse_ife(struct action_util *a, int *argc_p, char ***argv_p,
                        NEXT_ARG();
                        if (get_u16(&ife_type, *argv, 0))
                                invarg("ife type is invalid", *argv);
-                       fprintf(stderr, "IFE type 0x%x\n", ife_type);
+                       fprintf(stderr, "IFE type 0x%04X\n", ife_type);
                        user_type = 1;
                } else if (matches(*argv, "dst") == 0) {
                        NEXT_ARG();
@@ -160,6 +159,7 @@ static int parse_ife(struct action_util *a, int *argc_p, char ***argv_p,
 
        parse_action_control_dflt(&argc, &argv, &p.action, false, TC_ACT_PIPE);
 
+       NEXT_ARG_FWD();
        if (argc) {
                if (matches(*argv, "index") == 0) {
                        NEXT_ARG();
@@ -189,6 +189,8 @@ static int parse_ife(struct action_util *a, int *argc_p, char ***argv_p,
                addattr_l(n, MAX_MSG, TCA_IFE_DMAC, dbuf, ETH_ALEN);
        if (user_type)
                addattr_l(n, MAX_MSG, TCA_IFE_TYPE, &ife_type, 2);
+       else
+               fprintf(stderr, "IFE type 0x%04X\n", ETH_P_IFE);
        if (saddr)
                addattr_l(n, MAX_MSG, TCA_IFE_SMAC, sbuf, ETH_ALEN);