diff mbox series

[iproute2-next,02/20] bridge: vni: Remove dead code in group argument parsing

Message ID 20231211140732.11475-3-bpoirier@nvidia.com (mailing list archive)
State Accepted
Commit ba1e68f04be3b6f391e236ff8e034709c8acc278
Delegated to: Stephen Hemminger
Headers show
Series bridge: vni: UI fixes | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Benjamin Poirier Dec. 11, 2023, 2:07 p.m. UTC
is_addrtype_inet_not_multi(&daddr) may read an uninitialized "daddr". Even
if that is fixed, the error message that follows cannot be reached because
the situation would be caught by the previous test (group_present).
Therefore, remove this test on daddr.

Fixes: 45cd32f9f7d5 ("bridge: vxlan device vnifilter support")
Reviewed-by: Petr Machata <petrm@nvidia.com>
Tested-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Benjamin Poirier <bpoirier@nvidia.com>
---
 bridge/vni.c | 5 -----
 1 file changed, 5 deletions(-)

Comments

Stephen Hemminger Dec. 21, 2023, 3:58 a.m. UTC | #1
On Mon, 11 Dec 2023 09:07:14 -0500
Benjamin Poirier <bpoirier@nvidia.com> wrote:

> is_addrtype_inet_not_multi(&daddr) may read an uninitialized "daddr". Even
> if that is fixed, the error message that follows cannot be reached because
> the situation would be caught by the previous test (group_present).
> Therefore, remove this test on daddr.
> 
> Fixes: 45cd32f9f7d5 ("bridge: vxlan device vnifilter support")
> Reviewed-by: Petr Machata <petrm@nvidia.com>
> Tested-by: Petr Machata <petrm@nvidia.com>
> Signed-off-by: Benjamin Poirier <bpoirier@nvidia.com>
> ---
>  bridge/vni.c | 5 -----
>  1 file changed, 5 deletions(-)
> 
> diff --git a/bridge/vni.c b/bridge/vni.c
> index 6c0e35cd..33e50d18 100644
> --- a/bridge/vni.c
> +++ b/bridge/vni.c
> @@ -109,11 +109,6 @@ static int vni_modify(int cmd, int argc, char **argv)
>  		} else if (strcmp(*argv, "group") == 0) {
>  			if (group_present)
>  				invarg("duplicate group", *argv);
> -			if (is_addrtype_inet_not_multi(&daddr)) {
> -				fprintf(stderr, "vxlan: both group and remote");
> -				fprintf(stderr, " cannot be specified\n");
> -				return -1;
> -			}
>  			NEXT_ARG();
>  			get_addr(&daddr, *argv, AF_UNSPEC);
>  			if (!is_addrtype_inet_multi(&daddr))


This makes sense, and why was the message split in the first place.

Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
diff mbox series

Patch

diff --git a/bridge/vni.c b/bridge/vni.c
index 6c0e35cd..33e50d18 100644
--- a/bridge/vni.c
+++ b/bridge/vni.c
@@ -109,11 +109,6 @@  static int vni_modify(int cmd, int argc, char **argv)
 		} else if (strcmp(*argv, "group") == 0) {
 			if (group_present)
 				invarg("duplicate group", *argv);
-			if (is_addrtype_inet_not_multi(&daddr)) {
-				fprintf(stderr, "vxlan: both group and remote");
-				fprintf(stderr, " cannot be specified\n");
-				return -1;
-			}
 			NEXT_ARG();
 			get_addr(&daddr, *argv, AF_UNSPEC);
 			if (!is_addrtype_inet_multi(&daddr))