diff options
author | Mercury <mercury124185@gmail.com> | 2021-12-11 15:58:32 +0800 |
---|---|---|
committer | Mercury <mercury124185@gmail.com> | 2021-12-12 08:26:49 +0800 |
commit | 8ade4a568a51db6f38d7b0508484d433af21f7a1 (patch) | |
tree | eb0e2601ee4e8279dd369f742409510a5b45c966 /src/vnet/tcp/tcp_cli.c | |
parent | 7c3275e84b64ade4e20d00e4457bd4e437b1894f (diff) |
tcp: fix the tcp src-address cli
When the src-address to add match a route
without a valid output interface(such as default route 0.0.0.0/0),
fib_entry_get_resolving_interface() will return (u32)~0,
which will cause crash in ip4_neighbor_proxy_enable().
Type: fix
Signed-off-by: Mercury <mercury124185@gmail.com>
Change-Id: I5aee5676a2ff43ec06745ebed4dba2b9e5b98c4d
Diffstat (limited to 'src/vnet/tcp/tcp_cli.c')
-rw-r--r-- | src/vnet/tcp/tcp_cli.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/vnet/tcp/tcp_cli.c b/src/vnet/tcp/tcp_cli.c index c7b5c0b441e..c9d6c6facd6 100644 --- a/src/vnet/tcp/tcp_cli.c +++ b/src/vnet/tcp/tcp_cli.c @@ -411,6 +411,8 @@ tcp_configure_v4_source_address_range (vlib_main_t * vm, return VNET_API_ERROR_NEXT_HOP_NOT_IN_FIB; sw_if_index = fib_entry_get_resolving_interface (fei); + if (sw_if_index == (u32) ~0) + return VNET_API_ERROR_NO_MATCHING_INTERFACE; /* Configure proxy arp across the range */ rv = ip4_neighbor_proxy_add (fib_index, start, end); |