diff options
author | Pavel Machek <pavel@ucw.cz> | 1999-05-31 19:43:08 +0000 |
---|---|---|
committer | Pavel Machek <pavel@ucw.cz> | 1999-05-31 19:43:08 +0000 |
commit | 9607536dbf7c50f9c2fc7a670eab51e5c313d10f (patch) | |
tree | 3bdb1494d3788c2e4d3a99ada22f572514ec9f60 /proto/rip | |
parent | 72efa4b6f82222f91b63b9f61bbc88e458096ea7 (diff) |
Kill duplicity between rif and rif_patt.
Diffstat (limited to 'proto/rip')
-rw-r--r-- | proto/rip/config.Y | 4 | ||||
-rw-r--r-- | proto/rip/rip.c | 2 | ||||
-rw-r--r-- | proto/rip/rip.h | 13 |
3 files changed, 8 insertions, 11 deletions
diff --git a/proto/rip/config.Y b/proto/rip/config.Y index a3e877da..c00ecc56 100644 --- a/proto/rip/config.Y +++ b/proto/rip/config.Y @@ -93,8 +93,8 @@ CF_CODE void rip_dev_add_iface(char *n) { - struct rip_patt *k = cfg_alloc(sizeof(struct rip_patt)); - + struct rip_patt *k = cfg_allocz(sizeof(struct rip_patt)); + k->metric = 1; k->i.pattern = cfg_strdup(n); add_tail(&RIP_CFG->iface_list, &k->i.n); } diff --git a/proto/rip/rip.c b/proto/rip/rip.c index 144bc7cb..430dbfd6 100644 --- a/proto/rip/rip.c +++ b/proto/rip/rip.c @@ -218,7 +218,7 @@ advertise_entry( struct proto *p, struct rip_block *b, ip_addr whotoldme ) } n = net_get( p->table, b->network, ipa_mklen( b->netmask )); r = rte_get_temp(a); - r->u.rip.metric = ntohl(b->metric) + rif->metric; + r->u.rip.metric = ntohl(b->metric) + rif->patt->metric; if (r->u.rip.metric > P_CF->infinity) r->u.rip.metric = P_CF->infinity; r->u.rip.tag = ntohl(b->tag); r->net = n; diff --git a/proto/rip/rip.h b/proto/rip/rip.h index 874c5652..cee1b905 100644 --- a/proto/rip/rip.h +++ b/proto/rip/rip.h @@ -87,14 +87,6 @@ struct rip_interface { sock *sock; struct rip_connection *busy; struct rip_patt *patt; - - int metric; /* User configurable data */ - int mode; -#define IM_MULTICAST 1 -#define IM_BROADCAST 2 -#define IM_QUIET 4 -#define IM_NOLISTEN 8 -#define IM_VERSION1 16 }; struct rip_patt { @@ -102,6 +94,11 @@ struct rip_patt { int metric; int mode; +#define IM_MULTICAST 1 +#define IM_BROADCAST 2 +#define IM_QUIET 4 +#define IM_NOLISTEN 8 +#define IM_VERSION1 16 }; struct rip_proto_config { |