struct vlist_tree iprules;
static bool iprules_flushed = false;
+static unsigned int iprules_counter[2];
enum {
RULE_INTERFACE_IN,
return;
rule->flags = v6 ? IPRULE_INET6 : IPRULE_INET4;
+ rule->order = iprules_counter[rule->flags]++;
if ((cur = tb[RULE_INVERT]) != NULL)
rule->invert = blobmsg_get_bool(cur);
void
iprule_update_start(void)
{
+ iprules_counter[0] = 1;
+ iprules_counter[1] = 1;
vlist_update(&iprules);
}
if (rule->flags & IPRULE_PRIORITY)
nla_put_u32(msg, FRA_PRIORITY, rule->priority);
+ else if (cmd == RTM_NEWRULE)
+ nla_put_u32(msg, FRA_PRIORITY, rule->order);
if (rule->flags & IPRULE_FWMARK)
nla_put_u32(msg, FRA_FWMARK, rule->fwmark);