]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
Revert "tc: flower: Allow *_mac options to accept a mask"
authorStephen Hemminger <stephen@networkplumber.org>
Thu, 22 Dec 2016 00:06:49 +0000 (16:06 -0800)
committerStephen Hemminger <stephen@networkplumber.org>
Thu, 22 Dec 2016 00:06:49 +0000 (16:06 -0800)
This reverts commit 0390185078dedd551028fba58d53ef303ab57a2f.

man/man8/tc-flower.8
tc/f_flower.c

index bc488523e66b5731b78164b504acf0ceec3c5d9a..c5ddf3cbb14d924936133a63060f3513828d86f1 100644 (file)
@@ -22,7 +22,7 @@ flower \- flow based traffic control filter
 .BR skip_sw " | " skip_hw
 .R " | { "
 .BR dst_mac " | " src_mac " } "
-.IR MASKED_LLADDR " | "
+.IR mac_address " | "
 .B vlan_id
 .IR VID " | "
 .B vlan_prio
@@ -74,15 +74,10 @@ filter, or TC offload is not enabled for the interface, operation will fail.
 .BI skip_hw
 Do not process filter by hardware.
 .TP
-.BI dst_mac " MASKED_LLADDR"
+.BI dst_mac " mac_address"
 .TQ
-.BI src_mac " MASKED_LLADDR"
-Match on source or destination MAC address.  A mask may be optionally
-provided to limit the bits of the address which are matched. A mask is
-provided by following the address with a slash and then the mask. It may be
-provided in LLADDR format, in which case it is a bitwise mask, or as a
-number of high bits to match. If the mask is missing then a match on all
-bits is assumed.
+.BI src_mac " mac_address"
+Match on source or destination MAC address.
 .TP
 .BI vlan_id " VID"
 Match on vlan tag id.
index df73bb28cf72bd388d1d6d2d39571b4061a7b0aa..653dfefc060af66beb8c37a19f3b12a97c87c62b 100644 (file)
@@ -45,8 +45,8 @@ static void explain(void)
                "                       vlan_id VID |\n"
                "                       vlan_prio PRIORITY |\n"
                "                       vlan_ethtype [ ipv4 | ipv6 | ETH-TYPE ] |\n"
-               "                       dst_mac MASKED-LLADDR |\n"
-               "                       src_mac MASKED-LLADDR |\n"
+               "                       dst_mac MAC-ADDR |\n"
+               "                       src_mac MAC-ADDR |\n"
                "                       ip_proto [tcp | udp | sctp | icmp | icmpv6 | IP-PROTO ] |\n"
                "                       dst_ip [ IPV4-ADDR | IPV6-ADDR ] |\n"
                "                       src_ip [ IPV4-ADDR | IPV6-ADDR ] |\n"
@@ -58,7 +58,6 @@ static void explain(void)
                "                       enc_src_ip [ IPV4-ADDR | IPV6-ADDR ] |\n"
                "                       enc_key_id [ KEY-ID ] }\n"
                "       FILTERID := X:Y:Z\n"
-               "       MASKED_LLADDR := { LLADDR | LLADDR/MASK | LLADDR/BITS }\n"
                "       ACTION-SPEC := ... look at individual actions\n"
                "\n"
                "NOTE: CLASSID, IP-PROTO are parsed as hexadecimal input.\n"
@@ -69,44 +68,16 @@ static void explain(void)
 static int flower_parse_eth_addr(char *str, int addr_type, int mask_type,
                                 struct nlmsghdr *n)
 {
-       int ret, err = -1;
-       char addr[ETH_ALEN], *slash;
-
-       slash = strchr(str, '/');
-       if (slash)
-               *slash = '\0';
+       int ret;
+       char addr[ETH_ALEN];
 
        ret = ll_addr_a2n(addr, sizeof(addr), str);
        if (ret < 0)
-               goto err;
+               return -1;
        addattr_l(n, MAX_MSG, addr_type, addr, sizeof(addr));
-
-       if (slash) {
-               unsigned bits;
-
-               if (!get_unsigned(&bits, slash + 1, 10)) {
-                       uint64_t mask;
-
-                       /* Extra 16 bit shift to push mac address into
-                        * high bits of uint64_t
-                        */
-                       mask = htonll(0xffffffffffffULL << (16 + 48 - bits));
-                       memcpy(addr, &mask, ETH_ALEN);
-               } else {
-                       ret = ll_addr_a2n(addr, sizeof(addr), slash + 1);
-                       if (ret < 0)
-                               goto err;
-               }
-       } else {
-               memset(addr, 0xff, ETH_ALEN);
-       }
+       memset(addr, 0xff, ETH_ALEN);
        addattr_l(n, MAX_MSG, mask_type, addr, sizeof(addr));
-
-       err = 0;
-err:
-       if (slash)
-               *slash = '/';
-       return err;
+       return 0;
 }
 
 static int flower_parse_vlan_eth_type(char *str, __be16 eth_type, int type,