summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/vrf.h17
-rw-r--r--lib/zclient.c3
-rw-r--r--ospfd/ospf_te.c8
-rw-r--r--pimd/pim_iface.c2
-rw-r--r--pimd/pim_ifchannel.c8
-rw-r--r--pimd/pimd.c4
-rw-r--r--pimd/pimd.h1
-rw-r--r--vtysh/vtysh_config.c68
-rw-r--r--zebra/zserv.c5
9 files changed, 72 insertions, 44 deletions
diff --git a/lib/vrf.h b/lib/vrf.h
index fe2b4842b0..d470349f00 100644
--- a/lib/vrf.h
+++ b/lib/vrf.h
@@ -56,6 +56,20 @@ enum {
#define VRF_CMD_HELP_STR "Specify the VRF\nThe VRF name\n"
#define VRF_ALL_CMD_HELP_STR "Specify the VRF\nAll VRFs\n"
+/*
+ * Pass some OS specific data up through
+ * to the daemons
+ */
+struct vrf_data
+{
+ union
+ {
+ struct {
+ uint32_t table_id;
+ } l;
+ };
+};
+
struct vrf
{
RB_ENTRY(vrf) id_entry, name_entry;
@@ -76,6 +90,9 @@ struct vrf
/* User data */
void *info;
+ /* The table_id from the kernel */
+ struct vrf_data data;
+
QOBJ_FIELDS
};
RB_HEAD (vrf_id_head, vrf);
diff --git a/lib/zclient.c b/lib/zclient.c
index a53e8112c8..b3a9338928 100644
--- a/lib/zclient.c
+++ b/lib/zclient.c
@@ -1077,12 +1077,15 @@ zclient_vrf_add (struct zclient *zclient, vrf_id_t vrf_id)
{
struct vrf *vrf;
char vrfname_tmp[VRF_NAMSIZ];
+ struct vrf_data data;
+ stream_get (&data, zclient->ibuf, sizeof (struct vrf_data));
/* Read interface name. */
stream_get (vrfname_tmp, zclient->ibuf, VRF_NAMSIZ);
/* Lookup/create vrf by vrf_id. */
vrf = vrf_get (vrf_id, vrfname_tmp);
+ vrf->data = data;
vrf_enable (vrf);
}
diff --git a/ospfd/ospf_te.c b/ospfd/ospf_te.c
index 804b1fb652..1afe20b958 100644
--- a/ospfd/ospf_te.c
+++ b/ospfd/ospf_te.c
@@ -838,8 +838,9 @@ initialize_linkparams (struct mpls_te_link *lp)
if ((oi = lookup_oi_by_ifp (ifp, NULL, OI_ANY)) == NULL)
{
- zlog_warn("MPLS-TE(initialize_linkparams) Could not find corresponding OSPF Interface for %s",
- ifp->name);
+ if (IS_DEBUG_OSPF_TE)
+ zlog_warn("MPLS-TE(initialize_linkparams) Could not find corresponding OSPF Interface for %s",
+ ifp->name);
return;
}
@@ -991,7 +992,8 @@ ospf_mpls_te_update_if (struct interface *ifp)
/* Get Link context from interface */
if ((lp = lookup_linkparams_by_ifp(ifp)) == NULL)
{
- zlog_warn ("OSPF MPLS-TE Update: Did not find Link Parameters context for interface %s", ifp->name);
+ if (IS_DEBUG_OSPF_TE)
+ zlog_warn ("OSPF MPLS-TE Update: Did not find Link Parameters context for interface %s", ifp->name);
return;
}
diff --git a/pimd/pim_iface.c b/pimd/pim_iface.c
index f36a9b3cbb..afaa951724 100644
--- a/pimd/pim_iface.c
+++ b/pimd/pim_iface.c
@@ -297,7 +297,7 @@ static int detect_primary_address_change(struct interface *ifp,
int changed;
if (force_prim_as_any)
- new_prim_addr = qpim_inaddr_any;
+ new_prim_addr.s_addr = INADDR_ANY;
else
new_prim_addr = pim_find_primary_addr(ifp);
diff --git a/pimd/pim_ifchannel.c b/pimd/pim_ifchannel.c
index 9b79c032c8..6dc607e1bc 100644
--- a/pimd/pim_ifchannel.c
+++ b/pimd/pim_ifchannel.c
@@ -387,12 +387,14 @@ const char *pim_ifchannel_ifassert_name(enum pim_ifassert_state ifassert_state)
*/
void reset_ifassert_state(struct pim_ifchannel *ch)
{
+ struct in_addr any = { .s_addr = INADDR_ANY };
+
THREAD_OFF(ch->t_ifassert_timer);
pim_ifassert_winner_set(ch,
- PIM_IFASSERT_NOINFO,
- qpim_inaddr_any,
- qpim_infinite_assert_metric);
+ PIM_IFASSERT_NOINFO,
+ any,
+ qpim_infinite_assert_metric);
}
struct pim_ifchannel *pim_ifchannel_find(struct interface *ifp,
diff --git a/pimd/pimd.c b/pimd/pimd.c
index 51a0833cd5..c31d2a99a1 100644
--- a/pimd/pimd.c
+++ b/pimd/pimd.c
@@ -61,7 +61,6 @@ struct thread *qpim_rpf_cache_refresher = NULL;
int64_t qpim_rpf_cache_refresh_requests = 0;
int64_t qpim_rpf_cache_refresh_events = 0;
int64_t qpim_rpf_cache_refresh_last = 0;
-struct in_addr qpim_inaddr_any;
struct list *qpim_ssmpingd_list = NULL;
struct in_addr qpim_ssmpingd_group_addr;
int64_t qpim_scan_oil_events = 0;
@@ -293,7 +292,6 @@ void pim_init()
pim_mroute_socket_enable();
- qpim_inaddr_any.s_addr = PIM_NET_INADDR_ANY;
/*
RFC 4601: 4.6.3. Assert Metrics
@@ -306,7 +304,7 @@ void pim_init()
qpim_infinite_assert_metric.rpt_bit_flag = 1;
qpim_infinite_assert_metric.metric_preference = PIM_ASSERT_METRIC_PREFERENCE_MAX;
qpim_infinite_assert_metric.route_metric = PIM_ASSERT_ROUTE_METRIC_MAX;
- qpim_infinite_assert_metric.ip_address = qpim_inaddr_any;
+ qpim_infinite_assert_metric.ip_address.s_addr = INADDR_ANY;
pim_if_init();
pim_cmd_init();
diff --git a/pimd/pimd.h b/pimd/pimd.h
index ec98c5bfd1..18520f57e1 100644
--- a/pimd/pimd.h
+++ b/pimd/pimd.h
@@ -140,7 +140,6 @@ struct thread *qpim_rpf_cache_refresher;
int64_t qpim_rpf_cache_refresh_requests;
int64_t qpim_rpf_cache_refresh_events;
int64_t qpim_rpf_cache_refresh_last;
-struct in_addr qpim_inaddr_any;
struct list *qpim_ssmpingd_list; /* list of struct ssmpingd_sock */
struct in_addr qpim_ssmpingd_group_addr;
int64_t qpim_scan_oil_events;
diff --git a/vtysh/vtysh_config.c b/vtysh/vtysh_config.c
index f25b5f26f7..9e40e3f518 100644
--- a/vtysh/vtysh_config.c
+++ b/vtysh/vtysh_config.c
@@ -183,9 +183,10 @@ vtysh_config_parse_line (void *arg, const char *line)
config->index = INTERFACE_NODE;
}
else if (config->index == RMAP_NODE ||
- config->index == INTERFACE_NODE ||
- config->index == NS_NODE ||
- config->index == VTY_NODE)
+ config->index == INTERFACE_NODE ||
+ config->index == NS_NODE ||
+ config->index == VTY_NODE ||
+ config->index == VRF_NODE)
config_add_line_uniq (config->line, line);
else
config_add_line (config->line, line);
@@ -278,6 +279,7 @@ vtysh_config_parse_line (void *arg, const char *line)
|| strncmp (line, "hostname", strlen ("hostname")) == 0
|| strncmp (line, "frr", strlen ("frr")) == 0
|| strncmp (line, "agentx", strlen ("agentx")) == 0
+ || strncmp (line, "no log", strlen ("no log")) == 0
)
config_add_line_uniq (config_top, line);
else
@@ -319,41 +321,41 @@ vtysh_config_dump (FILE *fp)
for (i = 0; i < vector_active (configvec); i++)
if ((master = vector_slot (configvec, i)) != NULL)
{
- for (ALL_LIST_ELEMENTS (master, node, nnode, config))
- {
- /* Don't print empty sections for interface/vrf. Route maps on the
- * other hand could have a legitimate empty section at the end.
- */
- if ((config->index == INTERFACE_NODE || (config->index == VRF_NODE))
- && list_isempty (config->line))
- continue;
-
- fprintf (fp, "%s\n", config->name);
- fflush (fp);
-
- for (ALL_LIST_ELEMENTS (config->line, mnode, mnnode, line))
- {
- fprintf (fp, "%s\n", line);
- fflush (fp);
- }
- if (! NO_DELIMITER (i))
- {
- fprintf (fp, "!\n");
- fflush (fp);
- }
- }
- if (NO_DELIMITER (i))
- {
- fprintf (fp, "!\n");
- fflush (fp);
- }
+ for (ALL_LIST_ELEMENTS (master, node, nnode, config))
+ {
+ /* Don't print empty sections for interface/vrf. Route maps on the
+ * other hand could have a legitimate empty section at the end.
+ */
+ if ((config->index == INTERFACE_NODE || config->index == VRF_NODE)
+ && list_isempty (config->line))
+ continue;
+
+ fprintf (fp, "%s\n", config->name);
+ fflush (fp);
+
+ for (ALL_LIST_ELEMENTS (config->line, mnode, mnnode, line))
+ {
+ fprintf (fp, "%s\n", line);
+ fflush (fp);
+ }
+ if (! NO_DELIMITER (i))
+ {
+ fprintf (fp, "!\n");
+ fflush (fp);
+ }
+ }
+ if (NO_DELIMITER (i))
+ {
+ fprintf (fp, "!\n");
+ fflush (fp);
+ }
}
for (i = 0; i < vector_active (configvec); i++)
if ((master = vector_slot (configvec, i)) != NULL)
{
- list_delete (master);
- vector_slot (configvec, i) = NULL;
+ list_delete (master);
+ vector_slot (configvec, i) = NULL;
}
list_delete_all_node (config_top);
}
diff --git a/zebra/zserv.c b/zebra/zserv.c
index 29cdb98082..ea4c769fa5 100644
--- a/zebra/zserv.c
+++ b/zebra/zserv.c
@@ -192,6 +192,11 @@ zserv_encode_interface (struct stream *s, struct interface *ifp)
static void
zserv_encode_vrf (struct stream *s, struct zebra_vrf *zvrf)
{
+ struct vrf_data data;
+
+ data.l.table_id = zvrf->table_id;
+ /* Pass the tableid */
+ stream_put (s, &data, sizeof (struct vrf_data));
/* Interface information. */
stream_put (s, zvrf_name (zvrf), VRF_NAMSIZ);