Skip to content

Commit

Permalink
ip-neighbor: fix ip6_ra_cmd
Browse files Browse the repository at this point in the history
The option parsing loop had "break" statements included in each
'if (unformat (line_input, "this-option ...") option_values=xxx;'
statement.

Result: the code would silently ignore all but the first
option. Probably broken forever, not easy to spot because the code
looks OK even though it's badly broken.

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I667bee85b4ca654b53fb3af421f957957ed0f0f8
  • Loading branch information
Dave Barach authored and florincoras committed Feb 26, 2020
1 parent 5fa4525 commit 7249b90
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions src/vnet/ip6-nd/ip6_ra.c
Original file line number Diff line number Diff line change
Expand Up @@ -1947,34 +1947,28 @@ ip6_ra_cmd (vlib_main_t * vm,
unformat_ip6_address, &ip6_addr, &addr_len))
{
add_radv_info = 0;
break;
}
else if (unformat (line_input, "ra-managed-config-flag"))
{
managed = 1;
break;
}
else if (unformat (line_input, "ra-other-config-flag"))
{
other = 1;
break;
}
else if (unformat (line_input, "ra-suppress") ||
unformat (line_input, "ra-surpress"))
{
suppress = 1;
break;
}
else if (unformat (line_input, "ra-suppress-link-layer") ||
unformat (line_input, "ra-surpress-link-layer"))
{
suppress_ll_option = 1;
break;
}
else if (unformat (line_input, "ra-send-unicast"))
{
send_unicast = 1;
break;
}
else if (unformat (line_input, "ra-lifetime"))
{
Expand All @@ -1984,7 +1978,6 @@ ip6_ra_cmd (vlib_main_t * vm,
goto done;
}
use_lifetime = 1;
break;
}
else if (unformat (line_input, "ra-initial"))
{
Expand All @@ -1994,7 +1987,6 @@ ip6_ra_cmd (vlib_main_t * vm,
error = unformat_parse_error (line_input);
goto done;
}
break;
}
else if (unformat (line_input, "ra-interval"))
{
Expand All @@ -2006,12 +1998,10 @@ ip6_ra_cmd (vlib_main_t * vm,

if (!unformat (line_input, "%d", &ra_min_interval))
ra_min_interval = 0;
break;
}
else if (unformat (line_input, "ra-cease"))
{
cease = 1;
break;
}
else
{
Expand Down

0 comments on commit 7249b90

Please sign in to comment.