1
0
mirror of https://gitlab.labs.nic.cz/labs/bird.git synced 2024-05-11 16:54:54 +00:00

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
This commit is contained in:
Ondrej Zajicek
2014-02-06 17:46:01 +01:00
parent f48fa14214
commit 48e5f32db6
26 changed files with 701 additions and 449 deletions

View File

@@ -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);
}
}
}