summaryrefslogtreecommitdiffstats
path: root/src/vnet
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet')
-rw-r--r--src/vnet/ethernet/arp.c2
-rw-r--r--src/vnet/feature/feature.c1
-rw-r--r--src/vnet/feature/feature.h1
-rw-r--r--src/vnet/feature/registration.c22
4 files changed, 25 insertions, 1 deletions
diff --git a/src/vnet/ethernet/arp.c b/src/vnet/ethernet/arp.c
index a42cfda0d3f..ca9a21cbbd1 100644
--- a/src/vnet/ethernet/arp.c
+++ b/src/vnet/ethernet/arp.c
@@ -1711,7 +1711,7 @@ VNET_FEATURE_ARC_INIT (arp_feat, static) =
{
.arc_name = "arp",
.start_nodes = VNET_FEATURES ("arp-input"),
- .last_in_arc = "arp-disabled",
+ .last_in_arc = "error-drop",
.arc_index_ptr = &ethernet_arp_main.feature_arc_index,
};
diff --git a/src/vnet/feature/feature.c b/src/vnet/feature/feature.c
index 47c8c62334f..6bef26257a9 100644
--- a/src/vnet/feature/feature.c
+++ b/src/vnet/feature/feature.c
@@ -122,6 +122,7 @@ vnet_feature_init (vlib_main_t * vm)
vcm = &cm->config_main;
if ((error = vnet_feature_arc_init
(vm, vcm, areg->start_nodes, areg->n_start_nodes,
+ areg->last_in_arc,
fm->next_feature_by_arc[arc_index],
fm->next_constraint_by_arc[arc_index],
&fm->feature_nodes[arc_index])))
diff --git a/src/vnet/feature/feature.h b/src/vnet/feature/feature.h
index 6e3401897f4..ef5f4c6ad7d 100644
--- a/src/vnet/feature/feature.h
+++ b/src/vnet/feature/feature.h
@@ -446,6 +446,7 @@ clib_error_t *vnet_feature_arc_init
vnet_config_main_t * vcm,
char **feature_start_nodes,
int num_feature_start_nodes,
+ char *last_in_arc,
vnet_feature_registration_t * first_reg,
vnet_feature_constraint_registration_t * first_const_set,
char ***in_feature_nodes);
diff --git a/src/vnet/feature/registration.c b/src/vnet/feature/registration.c
index fb10fbbe0db..030486a7489 100644
--- a/src/vnet/feature/registration.c
+++ b/src/vnet/feature/registration.c
@@ -122,6 +122,7 @@ vnet_feature_arc_init (vlib_main_t * vm,
vnet_config_main_t * vcm,
char **feature_start_nodes,
int num_feature_start_nodes,
+ char *last_in_arc,
vnet_feature_registration_t * first_reg,
vnet_feature_constraint_registration_t *
first_const_set, char ***in_feature_nodes)
@@ -154,6 +155,27 @@ vnet_feature_arc_init (vlib_main_t * vm,
this_reg = first_reg;
+ /* Autogenerate <node> before <last-in-arc> constraints */
+ if (last_in_arc)
+ {
+ while (this_reg)
+ {
+ /* If this isn't the last node in the arc... */
+ if (clib_strcmp (this_reg->node_name, last_in_arc))
+ {
+ /*
+ * Add an explicit constraint so this feature will run
+ * before the last node in the arc
+ */
+ constraint_tuple = format (0, "%s,%s%c", this_reg->node_name,
+ last_in_arc, 0);
+ vec_add1 (constraints, constraint_tuple);
+ }
+ this_reg = this_reg->next_in_arc;
+ }
+ this_reg = first_reg;
+ }
+
/* pass 1, collect feature node names, construct a before b pairs */
while (this_reg)
{