two kind of rules are being set from bgp flowspec: ipset based rules,
and ip rule rules. default route rules may have a lower priority than
the other rules ( that do not support default rules). so, if an ipset
rule without fwmark is being requested, then priority is arbitrarily set
to 1. the other case, priority is set to 0.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
if (bpf->type == BGP_PBR_IPRULE) {
memset(&pbr_rule, 0, sizeof(pbr_rule));
pbr_rule.vrf_id = bpf->vrf_id;
+ pbr_rule.priority = 20;
if (bpf->src) {
pbr_rule.flags |= MATCH_IP_SRC_SET;
prefix_copy(&pbr_rule.src, bpf->src);
struct bgp_pbr_action *action;
vrf_id_t vrf_id;
uint32_t unique;
+ uint32_t priority;
bool installed;
bool install_in_progress;
};
struct prefix pfx;
stream_putl(s, 0); /* seqno unused */
- stream_putl(s, 0); /* ruleno unused */
-
+ if (pbr)
+ stream_putl(s, pbr->priority);
+ else
+ stream_putl(s, 0);
+ /* ruleno unused - priority change
+ * ruleno permits distinguishing various FS PBR entries
+ * - FS PBR entries based on ipset/iptables
+ * - FS PBR entries based on iprule
+ * the latter may contain default routing information injected by FS
+ */
if (pbr)
stream_putl(s, pbr->unique);
else