pbrd: Allow pbr-policy add/removal to install/remove rules

The pbrm->installed variable was being used only in a couple
of places and it has no real bearing on whether or not
we should install a rule or not.  Remove this value.

Ticket: CM-20429
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
Donald Sharp 2018-04-09 15:41:37 -04:00
parent 56c63eeb23
commit d02e9432b5
2 changed files with 1 additions and 7 deletions

View File

@ -154,7 +154,7 @@ void pbr_map_add_interface(struct pbr_map *pbrm, struct interface *ifp_add)
bf_assign_index(pbrm->ifi_bitfield, pmi->install_bit); bf_assign_index(pbrm->ifi_bitfield, pmi->install_bit);
pbr_map_check_valid(pbrm->name); pbr_map_check_valid(pbrm->name);
if (pbrm->valid && !pbrm->installed) if (pbrm->valid)
pbr_map_install(pbrm); pbr_map_install(pbrm);
} }
@ -311,8 +311,6 @@ struct pbr_map_sequence *pbrms_get(const char *name, uint32_t seqno)
QOBJ_REG(pbrms, pbr_map_sequence); QOBJ_REG(pbrms, pbr_map_sequence);
listnode_add_sort(pbrm->seqnumbers, pbrms); listnode_add_sort(pbrm->seqnumbers, pbrms);
pbrm->installed = false;
} }
return pbrms; return pbrms;
@ -566,8 +564,6 @@ void pbr_map_install(struct pbr_map *pbrm)
for (ALL_LIST_ELEMENTS_RO(pbrm->seqnumbers, node, pbrms)) for (ALL_LIST_ELEMENTS_RO(pbrm->seqnumbers, node, pbrms))
for (ALL_LIST_ELEMENTS_RO(pbrm->incoming, inode, pmi)) for (ALL_LIST_ELEMENTS_RO(pbrm->incoming, inode, pmi))
pbr_send_pbr_map(pbrms, pmi, true); pbr_send_pbr_map(pbrms, pmi, true);
pbrm->installed = true;
} }
void pbr_map_init(void) void pbr_map_init(void)

View File

@ -49,8 +49,6 @@ struct pbr_map {
* what we think is the invalid reason * what we think is the invalid reason
*/ */
bool valid; bool valid;
bool installed;
}; };
RB_HEAD(pbr_map_entry_head, pbr_map); RB_HEAD(pbr_map_entry_head, pbr_map);