aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/ip-neighbor
diff options
context:
space:
mode:
authorMatthew Smith <mgsmith@netgate.com>2020-08-04 15:26:16 -0500
committerNeale Ranns <nranns@cisco.com>2020-08-25 07:45:40 +0000
commit4fa3aad33fffadec7b7614dc68c8f1d3d9f311c9 (patch)
tree76e2520125d99926facd3982b61a71ec11648d20 /src/vnet/ip-neighbor
parentbad679291a9dbc4d9274b1697f7ff41283deabd7 (diff)
ip-neighbor: skip probe for disabled interfaces
Type: fix In ip6_neighbor_probe(), if the interface is not enabled for ip6, return NULL and skip trying to build a packet. If the interface is not enabled, its mcast adjacency will be set to ~0 and a seg fault will ensue. Change-Id: I825c9f40a0d5b2a77f788ac8dbd618138706383d Signed-off-by: Matthew Smith <mgsmith@netgate.com>
Diffstat (limited to 'src/vnet/ip-neighbor')
-rw-r--r--src/vnet/ip-neighbor/ip6_neighbor.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/vnet/ip-neighbor/ip6_neighbor.h b/src/vnet/ip-neighbor/ip6_neighbor.h
index 934a2885ee1..7f76efd2c86 100644
--- a/src/vnet/ip-neighbor/ip6_neighbor.h
+++ b/src/vnet/ip-neighbor/ip6_neighbor.h
@@ -54,6 +54,12 @@ ip6_neighbor_probe (vlib_main_t * vm,
if (!h0)
return NULL;;
+ /* if the interface has been disabled for ip6, later steps to retrieve
+ * an adjacency will result in a segv.
+ */
+ if (!ip6_link_is_enabled (adj->rewrite_header.sw_if_index))
+ return NULL;
+
b0 = vlib_get_buffer (vm, bi0);
hw_if0 = vnet_get_sup_hw_interface (vnm, adj->rewrite_header.sw_if_index);