Commit bfd4641f authored by Adam Wujek's avatar Adam Wujek 💬

userspace/tools: allow setting parameters for vid 0 in wrs_vlans

It was not possible to pass parameters when vid 0 was the first one specified
wrs1#wrs_vlans --rvid 0 --rdrop 1 --rvid 1 --rdrop 1
wrs_vlans: missing "--rvid <vid>" before rtu cmd
However, it was possible if any other vid was specified before:
wrs1#wrs_vlans --rvid 1 --rdrop 1 --rvid 0 --rdrop 1
Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent bca0236a
......@@ -727,13 +727,13 @@ static int set_rtu_vlan(int vid, int fid, int pmask, int drop, int prio,
{
struct rtu_vlans_t *cur = rtu_vlans;;
if (!rtu_vlans && vid <= 0) {
if (!rtu_vlans && vid < 0) {
fprintf(stderr, "%s: missing \"--rvid <vid>\" before rtu cmd\n",
prgname);
return -1;
}
if (vid > 0) {
if (vid >= 0) {
cur = calloc(1, sizeof(*cur));
if (!cur) {
fprintf(stderr, "%s: %s\n", prgname, strerror(errno));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment