summaryrefslogtreecommitdiff
path: root/proto/ospf/topology.c
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2011-03-28 22:46:18 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2011-03-28 22:46:18 +0200
commit52a43ae3b76f86b697537bc3ad8afdb3b421cf2c (patch)
tree15a006b41f3e166c75f46f1ea45cc4fcb1502f5d /proto/ospf/topology.c
parentc454872f4e81e69a8e9950289ab810fcac3fc922 (diff)
Minor changes in addresses.
Mainly changes IA_UNNUMBERED to IA_PEER and adds IA_HOST. Also do not show broadcast addr in show interfaces. Nobody cares for that.
Diffstat (limited to 'proto/ospf/topology.c')
-rw-r--r--proto/ospf/topology.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/proto/ospf/topology.c b/proto/ospf/topology.c
index 1403e72e..78d88592 100644
--- a/proto/ospf/topology.c
+++ b/proto/ospf/topology.c
@@ -160,6 +160,7 @@ configured_stubnet(struct ospf_area *oa, struct ifa *a)
if (!oa->ac)
return 0;
+ /* Does not work for IA_PEER addresses, but it is not called on these */
struct ospf_stubnet_config *sn;
WALK_LIST(sn, oa->ac->stubnet_list)
{
@@ -254,7 +255,7 @@ originate_rt_lsa_body(struct ospf_area *oa, u16 *length)
ln = lsab_alloc(po, sizeof(struct ospf_lsa_rt_link));
ln->type = LSART_PTP;
ln->id = neigh->rid;
- ln->data = (ifa->addr->flags & IA_UNNUMBERED) ?
+ ln->data = (ifa->addr->flags & IA_PEER) ?
ifa->iface->index : ipa_to_u32(ifa->addr->ip);
ln->metric = ifa->cost;
ln->padding = 0;
@@ -301,12 +302,14 @@ originate_rt_lsa_body(struct ospf_area *oa, u16 *length)
/* Now we will originate stub area if there is no primary */
if (net_lsa ||
(ifa->type == OSPF_IT_VLINK) ||
- (ifa->addr->flags & IA_UNNUMBERED) ||
+ (ifa->addr->flags & IA_PEER) ||
configured_stubnet(oa, ifa->addr))
continue;
ln = lsab_alloc(po, sizeof(struct ospf_lsa_rt_link));
- if ((ifa->state == OSPF_IS_LOOP) || (ifa->type == OSPF_IT_PTMP))
+ if ((ifa->addr->flags & IA_HOST) ||
+ (ifa->state == OSPF_IS_LOOP) ||
+ (ifa->type == OSPF_IT_PTMP))
{
/* Host stub entry */
ln->type = LSART_STUB;
@@ -1208,7 +1211,7 @@ originate_prefix_rt_lsa_body(struct ospf_area *oa, u16 *length)
WALK_LIST(a, ifa->iface->addrs)
{
if ((a->flags & IA_SECONDARY) ||
- (a->flags & IA_UNNUMBERED) ||
+ (a->flags & IA_PEER) ||
(a->scope <= SCOPE_LINK))
continue;
@@ -1219,15 +1222,16 @@ originate_prefix_rt_lsa_body(struct ospf_area *oa, u16 *length)
configured_stubnet(oa, a))
continue;
- if ((ifa->state == OSPF_IS_LOOP) || (ifa->type == OSPF_IT_PTMP))
+ if ((a->flags & IA_HOST) ||
+ (ifa->state == OSPF_IS_LOOP) ||
+ (ifa->type == OSPF_IT_PTMP))
+ {
lsa_put_prefix(po, a->ip, MAX_PREFIX_LENGTH, 0);
+ host_addr = 1;
+ }
else
lsa_put_prefix(po, a->prefix, a->pxlen, ifa->cost);
i++;
-
- if ((ifa->state == OSPF_IS_LOOP) ||
- (a->pxlen == MAX_PREFIX_LENGTH))
- host_addr = 1;
}
ifa->px_pos_end = i;