diff options
author | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2019-07-24 15:08:03 +0200 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2019-07-24 15:08:03 +0200 |
commit | 18f70a6229f586d5e4f387075be42d7a1ef5d269 (patch) | |
tree | aa4f99f5eb0dbb62e36f820dea5e53b7522fd1b4 /nest/proto.c | |
parent | 048c2f0e8cc1451b1fa48e915e0bb5e124aa9d26 (diff) |
Nest: VRF of protocol can be explicitly specified as 'default'
Protocol can have specified VRF, in such case it is restricted to a set
of ifaces associated with the VRF, otherwise it can use all interfaces.
The patch allows to specify VRF as 'default', in which case it is
restricted to a set of iface not associated with any VRF.
Diffstat (limited to 'nest/proto.c')
-rw-r--r-- | nest/proto.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/nest/proto.c b/nest/proto.c index beb3f393..69661650 100644 --- a/nest/proto.c +++ b/nest/proto.c @@ -765,6 +765,7 @@ proto_init(struct proto_config *c, node *n) p->proto_state = PS_DOWN; p->last_state_change = current_time(); p->vrf = c->vrf; + p->vrf_set = c->vrf_set; insert_node(&p->n, n); p->event = ev_new_init(proto_pool, proto_event, p); @@ -932,7 +933,8 @@ proto_reconfigure(struct proto *p, struct proto_config *oc, struct proto_config if ((nc->protocol != oc->protocol) || (nc->net_type != oc->net_type) || (nc->disabled != p->disabled) || - (nc->vrf != oc->vrf)) + (nc->vrf != oc->vrf) || + (nc->vrf_set != oc->vrf_set)) return 0; p->name = nc->name; @@ -1838,8 +1840,8 @@ proto_cmd_show(struct proto *p, uintptr_t verbose, int cnt) cli_msg(-1006, " Message: %s", p->message); if (p->cf->router_id) cli_msg(-1006, " Router ID: %R", p->cf->router_id); - if (p->vrf) - cli_msg(-1006, " VRF: %s", p->vrf->name); + if (p->vrf_set) + cli_msg(-1006, " VRF: %s", p->vrf ? p->vrf->name : "default"); if (p->proto->show_proto_info) p->proto->show_proto_info(p); |