summaryrefslogtreecommitdiff
path: root/proto/ospf/rt.c
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2014-02-06 17:46:01 +0100
committerOndrej Zajicek <santiago@crfreenet.org>2014-02-06 17:46:01 +0100
commit48e5f32db676645640f84ab3d630cce975aa6b20 (patch)
treeb940fc8156b3e0c18aab6c339a066bdb7a9ec1e0 /proto/ospf/rt.c
parentf48fa14214301382b2e6b134788a7506b61b664f (diff)
Many changes in I/O and OSPF sockets and packet handling.
I/O: - BSD: specify src addr on IP sockets by IP_HDRINCL - BSD: specify src addr on UDP sockets by IP_SENDSRCADDR - Linux: specify src addr on IP/UDP sockets by IP_PKTINFO - IPv6: specify src addr on IP/UDP sockets by IPV6_PKTINFO - Alternative SKF_BIND flag for binding to IP address - Allows IP/UDP sockets without tx_hook, on these sockets a packet is discarded when TX queue is full - Use consistently SOL_ for socket layer values. OSPF: - Packet src addr is always explicitly set - Support for secondary addresses in BSD - Dynamic RX/TX buffers - Fixes some minor buffer overruns - Interface option 'tx length' - Names for vlink pseudoifaces (vlinkX) - Vlinks use separate socket for TX - Vlinks do not use fixed associated iface - Fixes TTL for direct unicast packets - Fixes DONTROUTE for OSPF sockets - Use ifa->ifname instead of ifa->iface->name
Diffstat (limited to 'proto/ospf/rt.c')
-rw-r--r--proto/ospf/rt.c38
1 files changed, 18 insertions, 20 deletions
diff --git a/proto/ospf/rt.c b/proto/ospf/rt.c
index 52110aa1..1b39bda0 100644
--- a/proto/ospf/rt.c
+++ b/proto/ospf/rt.c
@@ -1079,44 +1079,42 @@ ospf_check_vlinks(struct proto_ospf *po)
{
struct proto *p = &po->proto;
- struct ospf_iface *iface;
- WALK_LIST(iface, po->iface_list)
+ struct ospf_iface *ifa;
+ WALK_LIST(ifa, po->iface_list)
{
- if (iface->type == OSPF_IT_VLINK)
+ if (ifa->type == OSPF_IT_VLINK)
{
struct top_hash_entry *tmp;
- tmp = ospf_hash_find_rt(po->gr, iface->voa->areaid, iface->vid);
+ tmp = ospf_hash_find_rt(po->gr, ifa->voa->areaid, ifa->vid);
if (tmp && (tmp->color == INSPF) && ipa_nonzero(tmp->lb) && tmp->nhs)
{
struct ospf_iface *nhi = ospf_iface_find(po, tmp->nhs->iface);
- if ((iface->state != OSPF_IS_PTP)
- || (iface->vifa != nhi)
- || !ipa_equal(iface->vip, tmp->lb))
+ if ((ifa->state != OSPF_IS_PTP)
+ || (ifa->vifa != nhi)
+ || !ipa_equal(ifa->vip, tmp->lb))
{
OSPF_TRACE(D_EVENTS, "Vlink peer %R found", tmp->lsa.id);
- ospf_iface_sm(iface, ISM_DOWN);
- iface->vifa = nhi;
- iface->iface = nhi->iface;
- iface->addr = nhi->addr;
- iface->sk = nhi->sk;
- iface->cost = tmp->dist;
- iface->vip = tmp->lb;
- ospf_iface_sm(iface, ISM_UP);
+ ospf_iface_sm(ifa, ISM_DOWN);
+ ifa->vifa = nhi;
+ ifa->addr = nhi->addr;
+ ifa->cost = tmp->dist;
+ ifa->vip = tmp->lb;
+ ospf_iface_sm(ifa, ISM_UP);
}
- else if ((iface->state == OSPF_IS_PTP) && (iface->cost != tmp->dist))
+ else if ((ifa->state == OSPF_IS_PTP) && (ifa->cost != tmp->dist))
{
- iface->cost = tmp->dist;
+ ifa->cost = tmp->dist;
schedule_rt_lsa(po->backbone);
}
}
else
{
- if (iface->state > OSPF_IS_DOWN)
+ if (ifa->state > OSPF_IS_DOWN)
{
- OSPF_TRACE(D_EVENTS, "Vlink peer %R lost", iface->vid);
- ospf_iface_sm(iface, ISM_DOWN);
+ OSPF_TRACE(D_EVENTS, "Vlink peer %R lost", ifa->vid);
+ ospf_iface_sm(ifa, ISM_DOWN);
}
}
}