diff options
author | Ondrej Zajicek <santiago@crfreenet.org> | 2014-02-06 17:46:01 +0100 |
---|---|---|
committer | Ondrej Zajicek <santiago@crfreenet.org> | 2014-02-06 17:46:01 +0100 |
commit | 48e5f32db676645640f84ab3d630cce975aa6b20 (patch) | |
tree | b940fc8156b3e0c18aab6c339a066bdb7a9ec1e0 /proto/ospf/neighbor.c | |
parent | f48fa14214301382b2e6b134788a7506b61b664f (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/neighbor.c')
-rw-r--r-- | proto/ospf/neighbor.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/proto/ospf/neighbor.c b/proto/ospf/neighbor.c index 61224ec2..faaaf232 100644 --- a/proto/ospf/neighbor.c +++ b/proto/ospf/neighbor.c @@ -69,7 +69,6 @@ ospf_neighbor_new(struct ospf_iface *ifa) add_tail(&ifa->neigh_list, NODE n); n->adj = 0; n->csn = 0; - n->ldbdes = mb_allocz(pool, ifa->iface->mtu); n->state = NEIGHBOR_DOWN; init_lists(n); @@ -286,10 +285,10 @@ can_do_adj(struct ospf_neighbor *n) { case OSPF_IS_DOWN: case OSPF_IS_LOOP: - bug("%s: Iface %s in down state?", p->name, ifa->iface->name); + bug("%s: Iface %s in down state?", p->name, ifa->ifname); break; case OSPF_IS_WAITING: - DBG("%s: Neighbor? on iface %s\n", p->name, ifa->iface->name); + DBG("%s: Neighbor? on iface %s\n", p->name, ifa->ifname); break; case OSPF_IS_DROTHER: if (((n->rid == ifa->drid) || (n->rid == ifa->bdrid)) @@ -303,15 +302,15 @@ can_do_adj(struct ospf_neighbor *n) i = 1; break; default: - bug("%s: Iface %s in unknown state?", p->name, ifa->iface->name); + bug("%s: Iface %s in unknown state?", p->name, ifa->ifname); break; } break; default: - bug("%s: Iface %s is unknown type?", p->name, ifa->iface->name); + bug("%s: Iface %s is unknown type?", p->name, ifa->ifname); break; } - DBG("%s: Iface %s can_do_adj=%d\n", p->name, ifa->iface->name, i); + DBG("%s: Iface %s can_do_adj=%d\n", p->name, ifa->ifname, i); return i; } @@ -556,9 +555,8 @@ neighbor_timer_hook(timer * timer) struct ospf_iface *ifa = n->ifa; struct proto *p = &ifa->oa->po->proto; - OSPF_TRACE(D_EVENTS, - "Inactivity timer fired on interface %s for neighbor %I.", - ifa->iface->name, n->ip); + OSPF_TRACE(D_EVENTS, "Inactivity timer fired on interface %s for neighbor %I.", + ifa->ifname, n->ip); ospf_neigh_remove(n); } @@ -591,7 +589,7 @@ ospf_neigh_bfd_hook(struct bfd_request *req) if (req->down) { OSPF_TRACE(D_EVENTS, "BFD session down for %I on %s", - n->ip, n->ifa->iface->name); + n->ip, n->ifa->ifname); ospf_neigh_remove(n); } @@ -641,8 +639,7 @@ ospf_sh_neigh_info(struct ospf_neighbor *n) pos = "ptp "; cli_msg(-1013, "%-1R\t%3u\t%s/%s\t%-5s\t%-10s %-1I", n->rid, n->priority, - ospf_ns[n->state], pos, etime, - (ifa->type == OSPF_IT_VLINK ? "vlink" : ifa->iface->name), n->ip); + ospf_ns[n->state], pos, etime, ifa->ifname, n->ip); } static void @@ -653,7 +650,7 @@ rxmt_timer_hook(timer * timer) struct top_hash_entry *en; DBG("%s: RXMT timer fired on interface %s for neigh: %I.\n", - p->name, n->ifa->iface->name, n->ip); + p->name, n->ifa->ifname, n->ip); if(n->state < NEIGHBOR_EXSTART) return; |