__PRETTY_FUNCTION__, pbrm->name, pbrms->seqno, pbrms->reason);
if (pbrms->reason == PBR_MAP_VALID_SEQUENCE_NUMBER) {
- if (pbrms->installed) {
- install = false;
- for (ALL_LIST_ELEMENTS_RO(pbrm->incoming, inode, pmi)) {
- pbr_send_pbr_map(pbrms, pmi, install);
- }
- install = true;
- }
install = true;
DEBUGD(&pbr_dbg_map, "%s: Installing %s(%u) reason: %" PRIu64,
__PRETTY_FUNCTION__, pbrm->name, pbrms->seqno,
struct prefix *src;
struct prefix *dst;
+ /*
+ * Family of the src/dst. Needed when deleting since we clear them
+ */
+ unsigned char family;
+
/*
* The nexthop group we auto create
* for when the user specifies a individual
{
struct pbr_map_sequence *pbrms = VTY_GET_CONTEXT(pbr_map_sequence);
+ pbrms->family = prefix->family;
+
if (!no) {
if (prefix_same(pbrms->src, prefix))
return CMD_SUCCESS;
{
struct pbr_map_sequence *pbrms = VTY_GET_CONTEXT(pbr_map_sequence);
+ pbrms->family = prefix->family;
+
if (!no) {
if (prefix_same(pbrms->dst, prefix))
return CMD_SUCCESS;
static void pbr_encode_pbr_map_sequence_prefix(struct stream *s,
struct prefix *p,
- u_char family)
+ unsigned char family)
{
struct prefix any;
struct pbr_map_sequence *pbrms,
struct interface *ifp)
{
- u_char family;
+ unsigned char family;
family = AF_INET;
- if (pbrms->src)
- family = pbrms->src->family;
-
- if (pbrms->dst)
- family = pbrms->dst->family;
+ if (pbrms->family)
+ family = pbrms->family;
stream_putl(s, pbrms->seqno);
stream_putl(s, pbrms->ruleno);
req.frh.family = family;
req.frh.action = FR_ACT_TO_TBL;
- if (cmd == RTM_NEWRULE)
- req.n.nlmsg_flags |= NLM_F_CREATE | NLM_F_EXCL;
-
/* rule's pref # */
addattr32(&req.n, sizeof(req), FRA_PRIORITY, rule->priority);