diff options
Diffstat (limited to 'proto/ospf')
-rw-r--r-- | proto/ospf/config.Y | 4 | ||||
-rw-r--r-- | proto/ospf/iface.c | 3 | ||||
-rw-r--r-- | proto/ospf/neighbor.c | 5 | ||||
-rw-r--r-- | proto/ospf/packet.c | 4 |
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); } |