summaryrefslogtreecommitdiffstats
path: root/proto/rip
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2009-05-06 22:02:45 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2009-05-06 22:02:45 +0200
commit20e94fb85b7097b57089e3912475ac881fd5528d (patch)
tree0f85803ddd2d27440bc177887127000963103705 /proto/rip
parent10ab65a8c9eb846655feacd22c29747743a65328 (diff)
downloadbird-20e94fb85b7097b57089e3912475ac881fd5528d.tar
bird-20e94fb85b7097b57089e3912475ac881fd5528d.zip
A change in OSPF and RIP interface patterns.
Allows to add more interface patterns to one common 'options' section like: interface "eth3", "eth4" { options common to eth3 and eth4 }; Also removes undocumented and unnecessary ability to specify more interface patterns with different 'options' sections: interface "eth3" { options ... }, "eth4" { options ... };
Diffstat (limited to 'proto/rip')
-rw-r--r--proto/rip/config.Y25
-rw-r--r--proto/rip/rip.c4
2 files changed, 14 insertions, 15 deletions
diff --git a/proto/rip/config.Y b/proto/rip/config.Y
index f1ae43c..9a11069 100644
--- a/proto/rip/config.Y
+++ b/proto/rip/config.Y
@@ -55,7 +55,7 @@ rip_cfg:
| rip_cfg HONOR ALWAYS ';' { RIP_CFG->honor = HO_ALWAYS; }
| rip_cfg HONOR NEIGHBOR ';' { RIP_CFG->honor = HO_NEIGHBOR; }
| rip_cfg HONOR NEVER ';' { RIP_CFG->honor = HO_NEVER; }
- | rip_cfg rip_iface_list ';'
+ | rip_cfg INTERFACE rip_iface ';'
;
rip_auth:
@@ -64,6 +64,7 @@ rip_auth:
| NONE { $$=AT_NONE; }
;
+
rip_mode:
BROADCAST { $$=IM_BROADCAST; }
| MULTICAST { $$=0; }
@@ -78,28 +79,26 @@ rip_iface_item:
;
rip_iface_opts:
- '{'
+ /* empty */
| rip_iface_opts rip_iface_item ';'
;
-rip_iface_opt_list: /* EMPTY */ | rip_iface_opts '}' ;
+rip_iface_opt_list:
+ /* empty */
+ | '{' rip_iface_opts '}'
+ ;
rip_iface_init:
/* EMPTY */ {
- struct rip_patt *k = cfg_allocz(sizeof(struct rip_patt));
- k->metric = 1;
- add_tail(&RIP_CFG->iface_list, &k->i.n);
- this_ipatt = &k->i;
+ this_ipatt = cfg_allocz(sizeof(struct rip_patt));
+ add_tail(&RIP_CFG->iface_list, NODE this_ipatt);
+ init_list(&this_ipatt->ipn_list);
+ RIP_IPATT->metric = 1;
}
;
rip_iface:
- rip_iface_init iface_patt rip_iface_opt_list
- ;
-
-rip_iface_list:
- INTERFACE rip_iface
- | rip_iface_list ',' rip_iface
+ rip_iface_init iface_patt_list rip_iface_opt_list
;
CF_ADDTO(dynamic_attr, RIP_METRIC { $$ = f_new_dynamic_attr(EAF_TYPE_INT | EAF_TEMP, T_INT, EA_RIP_METRIC); })
diff --git a/proto/rip/rip.c b/proto/rip/rip.c
index b5a4cc3..12cc878 100644
--- a/proto/rip/rip.c
+++ b/proto/rip/rip.c
@@ -742,7 +742,7 @@ rip_real_if_add(struct object_lock *lock)
struct iface *iface = lock->iface;
struct proto *p = lock->data;
struct rip_interface *rif;
- struct iface_patt *k = iface_patt_match(&P_CF->iface_list, iface);
+ struct iface_patt *k = iface_patt_find(&P_CF->iface_list, iface);
if (!k)
bug("This can not happen! It existed few seconds ago!" );
@@ -771,7 +771,7 @@ rip_if_notify(struct proto *p, unsigned c, struct iface *iface)
}
}
if (c & IF_CHANGE_UP) {
- struct iface_patt *k = iface_patt_match(&P_CF->iface_list, iface);
+ struct iface_patt *k = iface_patt_find(&P_CF->iface_list, iface);
struct object_lock *lock;
struct rip_patt *PATT = (struct rip_patt *) k;