summaryrefslogtreecommitdiff
path: root/proto/ospf
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2015-12-24 15:52:03 +0100
committerOndrej Zajicek (work) <santiago@crfreenet.org>2015-12-24 15:56:04 +0100
commit04632fd77f291f67753341d12d540f7dac341bd3 (patch)
tree94b319a0fe0e312539857e76e0b9d6982ce81555 /proto/ospf
parent70b90dde23a684c4d32aa53685f76a73ecba941d (diff)
Follow-up work on integration
Diffstat (limited to 'proto/ospf')
-rw-r--r--proto/ospf/config.Y4
-rw-r--r--proto/ospf/iface.c3
-rw-r--r--proto/ospf/neighbor.c5
-rw-r--r--proto/ospf/packet.c4
4 files changed, 9 insertions, 7 deletions
diff --git a/proto/ospf/config.Y b/proto/ospf/config.Y
index 5673ef60..881ec781 100644
--- a/proto/ospf/config.Y
+++ b/proto/ospf/config.Y
@@ -220,7 +220,7 @@ ospf_stubnet_start:
net_ip {
this_stubnet = cfg_allocz(sizeof(struct ospf_stubnet_config));
add_tail(&this_area->stubnet_list, NODE this_stubnet);
- this_stubnet->prefix = $1.n;
+ this_stubnet->prefix = $1;
this_stubnet->cost = COST_D;
}
;
@@ -330,7 +330,7 @@ pref_base: net_ip
{
this_pref = cfg_allocz(sizeof(struct area_net_config));
add_tail(this_nets, NODE this_pref);
- this_pref->prefix = $1.n;
+ this_pref->prefix = $1;
}
;
diff --git a/proto/ospf/iface.c b/proto/ospf/iface.c
index 442cec3a..8c997ced 100644
--- a/proto/ospf/iface.c
+++ b/proto/ospf/iface.c
@@ -581,6 +581,7 @@ ospf_iface_new(struct ospf_area *oa, struct ifa *addr, struct ospf_iface_patt *i
if (ip->ptp_netmask < 2)
ifa->ptp_netmask = ip->ptp_netmask;
+ ifa->drip = ifa->bdrip = ospf_is_v2(p) ? IPA_NONE4 : IPA_NONE6;
ifa->type = ospf_iface_classify(ip->type, addr);
@@ -1333,7 +1334,7 @@ ospf_iface_info(struct ospf_iface *ifa)
else if (ifa->addr->flags & IA_PEER)
cli_msg(-1015, "Interface %s (peer %I)", ifa->ifname, ifa->addr->opposite);
else
- cli_msg(-1015, "Interface %s (%N)", ifa->ifname, ifa->addr->prefix);
+ cli_msg(-1015, "Interface %s (%N)", ifa->ifname, &ifa->addr->prefix);
cli_msg(-1015, "\tType: %s%s", ospf_it[ifa->type], more);
cli_msg(-1015, "\tArea: %R (%u)", ifa->oa->areaid, ifa->oa->areaid);
diff --git a/proto/ospf/neighbor.c b/proto/ospf/neighbor.c
index c5d44dec..b30b0438 100644
--- a/proto/ospf/neighbor.c
+++ b/proto/ospf/neighbor.c
@@ -506,13 +506,14 @@ ospf_dr_election(struct ospf_iface *ifa)
u32 old_drid = ifa->drid;
u32 old_bdrid = ifa->bdrid;
+ ip_addr none = ospf_is_v2(p) ? IPA_NONE4 : IPA_NONE6;
ifa->drid = ndr ? ndr->rid : 0;
- ifa->drip = ndr ? ndr->ip : IPA_NONE;
+ ifa->drip = ndr ? ndr->ip : none;
ifa->dr_iface_id = ndr ? ndr->iface_id : 0;
ifa->bdrid = nbdr ? nbdr->rid : 0;
- ifa->bdrip = nbdr ? nbdr->ip : IPA_NONE;
+ ifa->bdrip = nbdr ? nbdr->ip : none;
DBG("DR=%R, BDR=%R\n", ifa->drid, ifa->bdrid);
diff --git a/proto/ospf/packet.c b/proto/ospf/packet.c
index 9690c28a..35ef7c6e 100644
--- a/proto/ospf/packet.c
+++ b/proto/ospf/packet.c
@@ -500,8 +500,8 @@ ospf_send_to_agt(struct ospf_iface *ifa, u8 state)
void
ospf_send_to_bdr(struct ospf_iface *ifa)
{
- if (ipa_nonzero(ifa->drip))
+ if (ipa_nonzero2(ifa->drip))
ospf_send_to(ifa, ifa->drip);
- if (ipa_nonzero(ifa->bdrip))
+ if (ipa_nonzero2(ifa->bdrip))
ospf_send_to(ifa, ifa->bdrip);
}