Allow "ivlan" (inner VLAN) to be used as an alias for "vlan" when

specifying match criteria.  "vlan" continues to be valid here, and it
continues to be valid when deleting, rewriting, inserting, or stacking
an 802.1q tag to a matching packet.

MFC after:	3 days
This commit is contained in:
Navdeep Parhar 2013-01-17 00:21:45 +00:00
parent ed8180e665
commit bfc486325b

View File

@ -955,7 +955,7 @@ set_filter(uint32_t idx, int argc, const char *argv[])
t.fs.mask.vnic = mask;
t.fs.val.vnic_vld = 1;
t.fs.mask.vnic_vld = 1;
} else if (!parse_val_mask("vlan", args, &val, &mask)) {
} else if (!parse_val_mask("ivlan", args, &val, &mask)) {
t.fs.val.vlan = val;
t.fs.mask.vlan = mask;
t.fs.val.vlan_vld = 1;
@ -1047,10 +1047,17 @@ set_filter(uint32_t idx, int argc, const char *argv[])
t.fs.newvlan = VLAN_REWRITE;
} else if (argv[start_arg + 1][0] == '+') {
t.fs.newvlan = VLAN_INSERT;
} else if (isdigit(argv[start_arg + 1][0]) &&
!parse_val_mask("vlan", args, &val, &mask)) {
t.fs.val.vlan = val;
t.fs.mask.vlan = mask;
t.fs.val.vlan_vld = 1;
t.fs.mask.vlan_vld = 1;
} else {
warnx("unknown vlan parameter \"%s\"; must"
" be one of \"none\", \"=<vlan>\" or"
" \"+<vlan>\"", argv[start_arg + 1]);
" be one of \"none\", \"=<vlan>\", "
" \"+<vlan>\", or \"<vlan>\"",
argv[start_arg + 1]);
return (EINVAL);
}
if (t.fs.newvlan == VLAN_REWRITE ||