diff options
Diffstat (limited to 'proto/ospf')
-rw-r--r-- | proto/ospf/config.Y | 15 | ||||
-rw-r--r-- | proto/ospf/iface.c | 2 | ||||
-rw-r--r-- | proto/ospf/ospf.c | 4 |
3 files changed, 9 insertions, 12 deletions
diff --git a/proto/ospf/config.Y b/proto/ospf/config.Y index bfe2d9c..7f7d6a3 100644 --- a/proto/ospf/config.Y +++ b/proto/ospf/config.Y @@ -13,9 +13,9 @@ CF_HDR CF_DEFINES #define OSPF_CFG ((struct ospf_config *) this_proto) -static struct ospf_area_config *this_area; -static struct iface_patt *this_ipatt; #define OSPF_PATT ((struct ospf_iface_patt *) this_ipatt) + +static struct ospf_area_config *this_area; static struct nbma_node *this_nbma; static struct area_net_config *this_pref; @@ -90,7 +90,7 @@ ospf_area_item: STUB COST expr { this_area->stub = $3 ; if($3<=0) cf_error("Stub cost must be greater than zero"); } | STUB bool {if($2) { if(!this_area->stub) this_area->stub=DEFAULT_STUB_COST;}else{ this_area->stub=0;}} | NETWORKS '{' pref_list '}' - | INTERFACE ospf_iface_list + | INTERFACE ospf_iface | ospf_vlink ; @@ -122,6 +122,7 @@ ospf_vlink_start: VIRTUAL LINK idval if (this_area->areaid == 0) cf_error("Virtual link cannot be in backbone"); this_ipatt = cfg_allocz(sizeof(struct ospf_iface_patt)); add_tail(&this_area->vlink_list, NODE this_ipatt); + init_list(&this_ipatt->ipn_list); OSPF_PATT->vid = $3; OSPF_PATT->cost = COST_D; OSPF_PATT->helloint = HELLOINT_D; @@ -222,6 +223,7 @@ ospf_iface_start: { this_ipatt = cfg_allocz(sizeof(struct ospf_iface_patt)); add_tail(&this_area->patt_list, NODE this_ipatt); + init_list(&this_ipatt->ipn_list); OSPF_PATT->cost = COST_D; OSPF_PATT->helloint = HELLOINT_D; OSPF_PATT->pollint = POLLINT_D; @@ -251,12 +253,7 @@ ospf_iface_opt_list: ; ospf_iface: - ospf_iface_start iface_patt ospf_iface_opt_list { finish_iface_config(OSPF_PATT); } - ; - -ospf_iface_list: - ospf_iface - | ospf_iface_list ',' ospf_iface + ospf_iface_start iface_patt_list ospf_iface_opt_list { finish_iface_config(OSPF_PATT); } ; opttext: diff --git a/proto/ospf/iface.c b/proto/ospf/iface.c index a4c9741..5162f9f 100644 --- a/proto/ospf/iface.c +++ b/proto/ospf/iface.c @@ -550,7 +550,7 @@ ospf_iface_notify(struct proto *p, unsigned flags, struct iface *iface) WALK_LIST(ac, c->area_list) { if (ip = (struct ospf_iface_patt *) - iface_patt_match(&ac->patt_list, iface)) + iface_patt_find(&ac->patt_list, iface)) break; } diff --git a/proto/ospf/ospf.c b/proto/ospf/ospf.c index 1eae376..0cab1d7 100644 --- a/proto/ospf/ospf.c +++ b/proto/ospf/ospf.c @@ -634,11 +634,11 @@ ospf_reconfigure(struct proto *p, struct proto_config *c) WALK_LIST(ifa, po->iface_list) { if (oldip = (struct ospf_iface_patt *) - iface_patt_match(&oldac->patt_list, ifa->iface)) + iface_patt_find(&oldac->patt_list, ifa->iface)) { /* Now reconfigure interface */ if (!(newip = (struct ospf_iface_patt *) - iface_patt_match(&newac->patt_list, ifa->iface))) + iface_patt_find(&newac->patt_list, ifa->iface))) return 0; /* HELLO TIMER */ |