summaryrefslogtreecommitdiff
path: root/usr.sbin/ospf6d
AgeCommit message (Collapse)Author
2009-11-02Add IMSG_CTL_LOG_VERBOSE similar to ospfd it allows to toggle debug logging.Claudio Jeker
henning, sthen, michele like the idea
2009-10-22write UNIX-domain in a more consistent way; while here, replace aIgor Sobrado
few remaining ".Tn UNIX" macros with ".Ux" ones. pointed out by ratchov@, thanks! ok jmc@
2009-10-22use the UNIX-related macros (.At and .Ux) where appropriate.Igor Sobrado
ok jmc@
2009-09-30Bring in sync with the bgpd version of carp.c. This fixes a memory leakClaudio Jeker
in an error path.
2009-09-30carp_demote_ioctl() can handle more then +/-1 steps so there is no need toClaudio Jeker
loop in the shutdown case. OK henning@
2009-09-20if_new() would treat the new interface as a virtual link if the ifnameStefan Sperling
parameter was NULL. But it's easy enough to make ifname != NULL by accident, e.g. by passing a zeroed or even uninitialised array. This function should accept a 'virtual' flag of some kind instead. Since we don't even support virtual links yet, change the check to "if (virtual)", #if 0 the check, and code that depends on it (including a file-scope variable), and add comments marking this as TODO. ok claudio, who requested #if 0 instead of deletion.
2009-09-20In kif_update(), the ifname array could be used uninitialised if theStefan Sperling
caller passed NULL for the sdl parameter. ok claudio@
2009-09-15Enclose repeated buffer draining code in a new msgbuf_drain()Jacek Masiulaniec
function, which is additionally exported for use by others. It will be needed by smtpd's SSL module when the SMTP client code is changed to replace libevent's evbuffers with our msgbuf_* API. ok gilles@ henning@ guenther@ eric@
2009-08-08Make imsg_clear close and free any fds in the received fd queue as well asNicholas Marriott
freeing the msgbuf. While here also remove an unnecessary while loop. ok eric pyr
2009-07-28Install interface addresses of other routers (LA bit set or 128 prefixlen)Claudio Jeker
as router type and not as a network. From stsp@
2009-07-28More fallout from the r1.31 commit. This time PID and the fd got swapped.Claudio Jeker
Again from stsp@
2009-07-28Running 'ospf6ctl show' twice caused ospf6d to fatal. Cause was a missing -Claudio Jeker
when passing -1 as fd to the imsg call. No frogs for eric@ and pyr@ From stsp@
2009-07-23make buf_write() behave like msgbuf_write(): send out only theEric Faurot
bytes that were filled, not the whole buffer. ok pyr@ gilles@
2009-06-08revert this change by eric@:David Gwynne
Make the imsg protocol network-safe. it might be network safe, but half the imsg based daemons on my firewalls dont run anymore.
2009-06-07Change the way fds passed over a socket are retreived on the receiving side.Eric Faurot
Currently the receiver fetches an imsg via imsg_get() and if he expects an fd, he then calls imsg_get_fd() to fetch the next fd queued on the imsgbuf from which the imsg came. This changes hides the fd queueing mechanism to the API user. When closing an imsg with an fd, the message is flagged so that the receiving end knows it must dequeue the fd in imsg_get() and return it with the imsg structure. This way there is no (less) possible screw up from imsg_get_fd() not being called directly after imsg_get() by the user. The retreived imsg is self-contained. ok pyr@, "I like that" henning@
2009-06-07Make the imsg protocol network-safe.Eric Faurot
ok pyr@
2009-06-06change the imsg header fields a bit to prepare for upcoming changes.Eric Faurot
add a flag field, use u_int32_t for pid_t and extend type to 32 bits for padding. ok pyr@
2009-06-06Get ready for including imsg.h from a lib, when it comes along.Pierre-Yves Ritschard
2009-06-06make ospf6ctl/ospf6d imsg-in-a-lib ready too.Eric Faurot
ospf6ctl is already broken in tree (not connected to build). ok pyr@
2009-06-05rtm->rtm_hdrlen conversionChris Cappuccio
ok claudio@, henning@
2009-05-31Remove redundant imsg_event_add calls; ok claudio@Jacek Masiulaniec
2009-05-31libevent handler fix to allow EV_READ and EV_WRITE to be set at the sameClaudio Jeker
time in the callback. Same diff that went into ospfd applied with some fuzz.
2009-04-09Update rt_calc() for OSPFv3. The Routing Information Base is beingStefan Sperling
populated. Intra-area routes only for now. "I see no obvious issues. Should go in so you can move forward" claudio@
2009-04-09Don't dereference NULL pointers. This crash wasn't found yet becauseStefan Sperling
we never entered this code path before. This is just a temporary fix. The kroute code desperately needs a sync to ospfd. "Looks sensible to me" jsing@, "Yes and yes" claudio@
2009-04-09Fix a naming inconsistency in struct lsa_intra_prefix (lsid -> ls_id).Stefan Sperling
"consistency is a good thing" jsing@, ok claudio@
2009-03-31Fixed memory leaks which would occur if the second of two memoryTobias Stoeckmann
allocations fails. looks right deraadt, krw ok henning
2009-03-29Update spf_calc() for OSPFv3.Stefan Sperling
This implements the first stage of the shortest path tree calculation (Dijkstra calculation) as outlined in rfc5340, with the exception that we do not yet treat multiple router LSAs originated by a single router as an agregate. For now, we only use the Router LSA with the lowest link state ID. For each destination, show the calculated set of nexthops in the debug log. We can stop doing this once spf tree calculation has been shown to be stable. "A lot of debug code but yes why not. commit it." claudio@
2009-03-29Update calc_nexthop() for OSPFv3, using helper functions added inStefan Sperling
last commit. Next hop IP addresses and outgoing interfaces can now be correctly determined, paving the way for SPF tree calculation. Arguments have changed, so update callers, too. ok claudio@
2009-03-29As a first step towards SPF tree calculation, prepare for properStefan Sperling
next-hop calculation. In OSPFv3, next-hop IP addresses are always link-local. The kernel will want to know which interface the link-local address belongs to, so we need an ifindex in struct v_nexthop in addition to the IP address. Because we cannot determine a link-local next hop IP address for transit networks, only the outgoing interface will be recorded. Update calc_nexthop_add() according to the above. Also add new helpers calc_nexthop_lladdr() and calc_nexthop_transit_nbr(), to figure out link-local addresses of nexthop neighbours. ok claudio@
2009-03-29Update linked() for OSPFv3.Stefan Sperling
A router vertex w has a point-to-point link back to a router vertex v if v's router ID occurs as neighbour ID in one of the point-to-point links described in w's router LSA. A router vertex w has a link back to a network vertex v if the router ID of v's advertising router (i.e. DR) occurs as neighbour ID in one of the transit links described in w's router LSA, and v's interface ID to the network matches the neighbour interface ID of that transit link. A network vertex w has a link back to a router vertex v if v's router ID occurs in the list of attached routers in w's network LSA. Also, get_rtr_link() and get_net_link() take an unsigned int now. "commit it" claudio@
2009-03-29Change get_net_link()'s idx argument to unsigned, and make itStefan Sperling
use less local variables. Makes it consistent with get_rtr_link(). ok claudio@
2009-03-29Because get_rtr_link() forgot to increment the buffer offsetStefan Sperling
it was always returning the first link in the LSA, no matter which link was requested. Fix this bug. Also, decrease the number of local variables while here, and convert the idx argument to unsigned int. Adjust one caller to pass an unsigned int, other callers will be handled in follow-up commits. ok claudio@
2009-03-29Remove lsa_find_net(), it isn't needed for OSPFv3.Stefan Sperling
pointed out by and ok claudio@
2009-03-29Add lsa_find_rtr() function, which finds among multiple routerStefan Sperling
LSAs originated by the same router the one with the lowest link state ID. ok claudio@
2009-03-29In lsa_num_links(), be more obvious about what parts of the LSAStefan Sperling
are subtracted from the total length. ok claudio@
2009-03-29Add log_rtr_id() function to log 32bit numbers in dot-quad notation.Stefan Sperling
Most obvious use is to log router IDs. To facilitate logging of multiple IDs within the same format string, we use NUM_LOGS static buffers, just like log_sockaddr() does. help and ok claudio@
2009-03-29Now that struct lsa_net represents just the options, orig_net_lsa()Stefan Sperling
can make use of it much better. No functional change. ok claudio@
2009-03-29Remove att_rtr field from struct lsa_net.Stefan Sperling
In Network-LSAs, the only thing sitting between the LSA header and the attached router list is the options field. We already have lsa_net_link to represent elements of the attached router list, so there's no need to have a single entry of this list in lsa_net. ok claudio@
2009-03-29For SPF calculation, we will need the source address specifiedStefan Sperling
in hello packets by next-hop neighbours. So when notifying the RDE of a new neighbour, send the source address, too. ok claudio@
2009-03-28Print the correct function name in log_debug().Michele Marchetto
ok stsp@
2009-03-12lsa_self() did too many things at once, and had too much logicStefan Sperling
buried inside of it that its caller relied on. So split it up as follows: lsa_self() Check whether an LSA is self-originated. lsa_flush() Flush an LSA from the LSDB. lsa_reflood() Prepare an LSA for reflooding (actual reflooding currently requires sending an imsg which must be done by the caller). ok claudio@
2009-03-10The linked() function had an identity crisis and referred to itselfStefan Sperling
as "spf_calc" in fatal error messages.
2009-03-10Revert previous, I committed the wrong file, should have been rde_spf.c.Stefan Sperling
2009-03-10The linked() function had an identity crisis and referred to itselfStefan Sperling
as "spf_calc" in fatal error messages.
2009-03-08Remove #ifdef'd code which had a TODO comment essentially askingStefan Sperling
"Do we need anything fancy to determine whether *-prefix-LSAs are self-originated?" The answer is "No, we don't, see section 4.6 of RFC5340." ok claudio@
2009-03-07Add lsa_find_tree() to allow searching for LSAs in a specific LSA tree.Stefan Sperling
We had code marked XXX searching an LSA tree manually using RB_FIND(), switch it over to lsa_find_tree(). Make lsa_find() use the new function, too, to avoid code duplication. ok claudio@
2009-02-25Fix an invalid pointer dereference in control_close(). If control_connbyfd()Claudio Jeker
fails -- which should never happen -- the function does not return and is accession the NULL set control pointer later on. Found by Matthew Haub. OK deraadt@
2009-02-19Use rde_router_id() instead of directly accessing rdeconf->rtr_id.s_addr.Stefan Sperling
"For sure!" claudio@
2009-02-19Enable origination of Intra-Area-Prefix LSAs in rde.Stefan Sperling
New Intra-Area-Prefix LSAs are originated when a neighbour becomes adjacent, or when a neighbour loses adjacency, or when an interface changes state. ok claudio@
2009-02-19Virtually re-implement origination of Intra-Area-Prefix LSAs.Stefan Sperling
We now comply with RFC5340 and move prefixes between the two ref-types of Intra-Area-Prefix LSAs (router and network). In case an LSA ends up having all of its prefixes moved to another one, the LSA is flushed from the LSDB by re-originating with MAX_AGE. (This does not yet work reliably. We end up having LSAs with zero prefixes in the LSDB in some cases. Should not affect SPF calculation, so not much harm done, but will need to be fixed.) This commit just adds the necessary code to do origination, but it is not being called yet. This will be done in a separate commit. "Looks good." claudio@