]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
bridge: vni: remove useless checks on vni
authorAndrea Claudi <aclaudi@redhat.com>
Fri, 26 May 2023 17:27:20 +0000 (19:27 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Fri, 26 May 2023 19:00:30 +0000 (12:00 -0700)
After the (d == NULL || vni == NULL) check, vni cannot be NULL anymore.

This remove two useless conditional checks on vni value:
- the first check cannot be true, so remove the whole conditional block
- the second check is always true, so remove the check

Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
bridge/vni.c

index 940f251cc6f1f7d20203954111b6fe7201d104c2..77328a4fc7782ed517c4ce2f8ba80469bcd731f7 100644 (file)
@@ -138,14 +138,8 @@ static int vni_modify(int cmd, int argc, char **argv)
                return -1;
        }
 
-       if (!vni && group_present) {
-               fprintf(stderr, "Group can only be specified with a vni\n");
-               return -1;
-       }
-
-       if (vni)
-               parse_vni_filter(vni, &req.n, sizeof(req),
-                                (group_present ? &daddr : NULL));
+       parse_vni_filter(vni, &req.n, sizeof(req),
+                        (group_present ? &daddr : NULL));
 
        req.tmsg.ifindex = ll_name_to_index(d);
        if (req.tmsg.ifindex == 0) {