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/ospf.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/ospf.c')
-rw-r--r-- | proto/ospf/ospf.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/proto/ospf/ospf.c b/proto/ospf/ospf.c index 232f3f6c..cf520401 100644 --- a/proto/ospf/ospf.c +++ b/proto/ospf/ospf.c @@ -232,7 +232,6 @@ ospf_start(struct proto *p) struct ospf_area_config *ac; po->router_id = proto_get_router_id(p->cf); - po->last_vlink_id = 0x80000000; po->rfc1583 = c->rfc1583; po->stub_router = c->stub_router; po->ebit = 0; @@ -258,10 +257,13 @@ ospf_start(struct proto *p) WALK_LIST(ac, c->area_list) ospf_area_add(po, ac, 0); + if (c->abr) + ospf_open_vlink_sk(po); + /* Add all virtual links */ struct ospf_iface_patt *ic; WALK_LIST(ic, c->vlink_list) - ospf_iface_new(po->backbone, NULL, ic); + ospf_iface_new_vlink(po, ic); return PS_UP; } @@ -277,7 +279,7 @@ ospf_dump(struct proto *p) WALK_LIST(ifa, po->iface_list) { - OSPF_TRACE(D_EVENTS, "Interface: %s", (ifa->iface ? ifa->iface->name : "(null)")); + OSPF_TRACE(D_EVENTS, "Interface: %s", ifa->ifname); OSPF_TRACE(D_EVENTS, "state: %u", ifa->state); OSPF_TRACE(D_EVENTS, "DR: %R", ifa->drid); OSPF_TRACE(D_EVENTS, "BDR: %R", ifa->bdrid); @@ -381,7 +383,7 @@ schedule_net_lsa(struct ospf_iface *ifa) { struct proto *p = &ifa->oa->po->proto; - OSPF_TRACE(D_EVENTS, "Scheduling network-LSA origination for iface %s", ifa->iface->name); + OSPF_TRACE(D_EVENTS, "Scheduling network-LSA origination for iface %s", ifa->ifname); ifa->orignet = 1; } @@ -391,7 +393,7 @@ schedule_link_lsa(struct ospf_iface *ifa) { struct proto *p = &ifa->oa->po->proto; - OSPF_TRACE(D_EVENTS, "Scheduling link-LSA origination for iface %s", ifa->iface->name); + OSPF_TRACE(D_EVENTS, "Scheduling link-LSA origination for iface %s", ifa->ifname); ifa->origlink = 1; } #endif @@ -631,7 +633,7 @@ ospf_get_route_info(rte * rte, byte * buf, ea_list * attrs UNUSED) { char *type = "<bug>"; - switch(rte->attrs->source) + switch (rte->attrs->source) { case RTS_OSPF: type = "I"; @@ -769,7 +771,7 @@ ospf_reconfigure(struct proto *p, struct proto_config *c) if (ifa) ospf_iface_reconfigure(ifa, ip); else - ospf_iface_new(po->backbone, NULL, ip); + ospf_iface_new_vlink(po, ip); } /* Delete remaining ifaces and areas */ @@ -808,7 +810,7 @@ ospf_sh_neigh(struct proto *p, char *iff) cli_msg(-1013, "%-12s\t%3s\t%-15s\t%-5s\t%-10s %-12s", "Router ID", "Pri", " State", "DTime", "Interface", "Router IP"); WALK_LIST(ifa, po->iface_list) - if ((iff == NULL) || patmatch(iff, ifa->iface->name)) + if ((iff == NULL) || patmatch(iff, ifa->ifname)) WALK_LIST(n, ifa->neigh_list) ospf_sh_neigh_info(n); cli_msg(0, ""); @@ -917,7 +919,7 @@ ospf_sh_iface(struct proto *p, char *iff) cli_msg(-1015, "%s:", p->name); WALK_LIST(ifa, po->iface_list) - if ((iff == NULL) || patmatch(iff, ifa->iface->name)) + if ((iff == NULL) || patmatch(iff, ifa->ifname)) ospf_iface_info(ifa); cli_msg(0, ""); } |