zebra: Replace vrf with zebra_vrf in a few places

We were incorrectly using vrf instead of zebra_vrf in a
few spots.

Ticket: CM-9412
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
This commit is contained in:
Donald Sharp 2016-03-22 16:37:17 -04:00
parent 7ab5795aee
commit 9e1bf607c1
6 changed files with 23 additions and 23 deletions

View File

@ -717,7 +717,7 @@ if_handle_vrf_change (struct interface *ifp, vrf_id_t vrf_id)
void void
vrf_add_update (struct vrf *vrfp) vrf_add_update (struct vrf *vrfp)
{ {
zebra_vrf_add_update (vrfp); zebra_vrf_add_update (vrf_info_lookup (vrfp->vrf_id));
if (! CHECK_FLAG (vrfp->status, ZEBRA_VRF_ACTIVE)) if (! CHECK_FLAG (vrfp->status, ZEBRA_VRF_ACTIVE))
{ {
@ -748,7 +748,7 @@ vrf_delete_update (struct vrf *vrfp)
zlog_debug ("VRF %s id %u is now inactive.", zlog_debug ("VRF %s id %u is now inactive.",
vrfp->name, vrfp->vrf_id); vrfp->name, vrfp->vrf_id);
zebra_vrf_delete_update (vrfp); zebra_vrf_delete_update (vrf_info_lookup (vrfp->vrf_id));
/* Pending: Update ifindex after distributing the delete message. This is in /* Pending: Update ifindex after distributing the delete message. This is in
case any client needs to have the old value of ifindex available case any client needs to have the old value of ifindex available

View File

@ -458,29 +458,29 @@ zebra_interface_delete_update (struct interface *ifp)
/* VRF information update. */ /* VRF information update. */
void void
zebra_vrf_add_update (struct vrf *vrfp) zebra_vrf_add_update (struct zebra_vrf *zvrf)
{ {
struct listnode *node, *nnode; struct listnode *node, *nnode;
struct zserv *client; struct zserv *client;
if (IS_ZEBRA_DEBUG_EVENT) if (IS_ZEBRA_DEBUG_EVENT)
zlog_debug ("MESSAGE: ZEBRA_VRF_ADD %s", vrfp->name); zlog_debug ("MESSAGE: ZEBRA_VRF_ADD %s", zvrf->name);
for (ALL_LIST_ELEMENTS (zebrad.client_list, node, nnode, client)) for (ALL_LIST_ELEMENTS (zebrad.client_list, node, nnode, client))
zsend_vrf_add (client, vrfp); zsend_vrf_add (client, zvrf);
} }
void void
zebra_vrf_delete_update (struct vrf *vrfp) zebra_vrf_delete_update (struct zebra_vrf *zvrf)
{ {
struct listnode *node, *nnode; struct listnode *node, *nnode;
struct zserv *client; struct zserv *client;
if (IS_ZEBRA_DEBUG_EVENT) if (IS_ZEBRA_DEBUG_EVENT)
zlog_debug ("MESSAGE: ZEBRA_VRF_DELETE %s", vrfp->name); zlog_debug ("MESSAGE: ZEBRA_VRF_DELETE %s", zvrf->name);
for (ALL_LIST_ELEMENTS (zebrad.client_list, node, nnode, client)) for (ALL_LIST_ELEMENTS (zebrad.client_list, node, nnode, client))
zsend_vrf_delete (client, vrfp); zsend_vrf_delete (client, zvrf);
} }
void void
@ -492,7 +492,7 @@ zebra_vrf_update_all (struct zserv *client)
for (iter = vrf_first (); iter != VRF_ITER_INVALID; iter = vrf_next (iter)) for (iter = vrf_first (); iter != VRF_ITER_INVALID; iter = vrf_next (iter))
{ {
if ((vrf = vrf_iter2vrf (iter)) && vrf->vrf_id) if ((vrf = vrf_iter2vrf (iter)) && vrf->vrf_id)
zsend_vrf_add (client, vrf); zsend_vrf_add (client, vrf_info_lookup (vrf->vrf_id));
} }
} }

View File

@ -42,9 +42,9 @@ extern void redistribute_delete (struct prefix *, struct rib *);
extern void zebra_interface_up_update (struct interface *); extern void zebra_interface_up_update (struct interface *);
extern void zebra_interface_down_update (struct interface *); extern void zebra_interface_down_update (struct interface *);
extern void zebra_vrf_add_update (struct vrf *); extern void zebra_vrf_add_update (struct zebra_vrf *);
extern void zebra_vrf_update_all (struct zserv *); extern void zebra_vrf_update_all (struct zserv *);
extern void zebra_vrf_delete_update (struct vrf *); extern void zebra_vrf_delete_update (struct zebra_vrf *);
extern void zebra_interface_add_update (struct interface *); extern void zebra_interface_add_update (struct interface *);
extern void zebra_interface_delete_update (struct interface *); extern void zebra_interface_delete_update (struct interface *);

View File

@ -47,9 +47,9 @@ void zebra_interface_delete_update (struct interface *a)
{ return; } { return; }
#endif #endif
void zebra_vrf_add_update (struct vrf *a) void zebra_vrf_add_update (struct zebra_vrf *a)
{ return; } { return; }
void zebra_vrf_delete_update (struct vrf *a) void zebra_vrf_delete_update (struct zebra_vrf *a)
{ return; } { return; }
void zebra_interface_address_add_update (struct interface *a, void zebra_interface_address_add_update (struct interface *a,

View File

@ -172,10 +172,10 @@ zserv_encode_interface (struct stream *s, struct interface *ifp)
} }
static void static void
zserv_encode_vrf (struct stream *s, struct vrf *vrfp) zserv_encode_vrf (struct stream *s, struct zebra_vrf *zvrf)
{ {
/* Interface information. */ /* Interface information. */
stream_put (s, vrfp->name, VRF_NAMSIZ); stream_put (s, zvrf->name, VRF_NAMSIZ);
/* Write packet size. */ /* Write packet size. */
stream_putw_at (s, 0, stream_get_endp (s)); stream_putw_at (s, 0, stream_get_endp (s));
@ -232,15 +232,15 @@ zsend_interface_delete (struct zserv *client, struct interface *ifp)
} }
int int
zsend_vrf_add (struct zserv *client, struct vrf *vrfp) zsend_vrf_add (struct zserv *client, struct zebra_vrf *zvrf)
{ {
struct stream *s; struct stream *s;
s = client->obuf; s = client->obuf;
stream_reset (s); stream_reset (s);
zserv_create_header (s, ZEBRA_VRF_ADD, vrfp->vrf_id); zserv_create_header (s, ZEBRA_VRF_ADD, zvrf->vrf_id);
zserv_encode_vrf (s, vrfp); zserv_encode_vrf (s, zvrf);
client->vrfadd_cnt++; client->vrfadd_cnt++;
return zebra_server_send_message(client); return zebra_server_send_message(client);
@ -248,15 +248,15 @@ zsend_vrf_add (struct zserv *client, struct vrf *vrfp)
/* VRF deletion from zebra daemon. */ /* VRF deletion from zebra daemon. */
int int
zsend_vrf_delete (struct zserv *client, struct vrf *vrfp) zsend_vrf_delete (struct zserv *client, struct zebra_vrf *zvrf)
{ {
struct stream *s; struct stream *s;
s = client->obuf; s = client->obuf;
stream_reset (s); stream_reset (s);
zserv_create_header (s, ZEBRA_VRF_DELETE, vrfp->vrf_id); zserv_create_header (s, ZEBRA_VRF_DELETE, zvrf->vrf_id);
zserv_encode_vrf (s, vrfp); zserv_encode_vrf (s, zvrf);
client->vrfdel_cnt++; client->vrfdel_cnt++;
return zebra_server_send_message (client); return zebra_server_send_message (client);

View File

@ -145,8 +145,8 @@ extern void zebra_route_map_init (void);
extern void zebra_snmp_init (void); extern void zebra_snmp_init (void);
extern void zebra_vty_init (void); extern void zebra_vty_init (void);
extern int zsend_vrf_add (struct zserv *, struct vrf *); extern int zsend_vrf_add (struct zserv *, struct zebra_vrf *);
extern int zsend_vrf_delete (struct zserv *, struct vrf *); extern int zsend_vrf_delete (struct zserv *, struct zebra_vrf *);
extern int zsend_interface_add (struct zserv *, struct interface *); extern int zsend_interface_add (struct zserv *, struct interface *);
extern int zsend_interface_delete (struct zserv *, struct interface *); extern int zsend_interface_delete (struct zserv *, struct interface *);