summaryrefslogtreecommitdiff
path: root/usr.sbin/ldpd
AgeCommit message (Collapse)Author
2013-11-26deal with msgbuf_write EAGAIN, ok gilles bennoHenning Brauer
2013-11-25use u_char for buffers in yylex, for ctype callsSebastian Benoit
found by millert@, ok deraadt@
2013-10-31another stray %dTheo de Raadt
2013-10-30another simple %i to %d conversion for obviousnessTheo de Raadt
2013-10-17Respect the max pdu length and merge all send_label* functions intoRenato Westphal
a single generic function.
2013-10-17Improve parsing of label mapping messages and merge all recv_label*Renato Westphal
functions into a single generic function. Add a few error checks and implement parsing of optional tlvs. Putting it all together helps avoid to code duplication and improve maintainability.
2013-10-15Don't bind a label for the default route.Renato Westphal
After discussing with claudio@ we came to the conclusion that it's more safe to ignore the default route and don't bind a label for it. OK @claudio
2013-10-15Minor fixes on if_del() and nbr_new().Renato Westphal
if_del(): this function is always called after an IF_EVT_DOWN event so there's no need to cleanup things here; nbr_new(): C structs shouldn't be copied directly. OK claudio@
2013-10-15Simplify the lde_nbr_new() function.Renato Westphal
There's no need the pass a whole lde_nbr structure as argument if we want only the neighbor IP address. Also, remove the lde_nbr_del() prototype on lde.h because it's a duplicate. OK claudio@
2013-10-15Simplify the code by avoiding direct calls to imsg_compose_event().Renato Westphal
OK claudio@
2013-10-15Improve debug and error logs.Renato Westphal
OK claudio@
2013-10-15Generate the NBR_EVT_PDU_RCVD event in a single point.Renato Westphal
OK claudio@
2013-10-15Fix whitespace and other style issues.Renato Westphal
OK claudio@
2013-10-15Since a targeted neighbor can be created both by configuration andRenato Westphal
on runtime, the ldpd_conf structure used should be passed as an argument to avoid segfaults.
2013-10-15Improve parsing of LDP messages.Renato Westphal
Add more sanity checks and send proper notification messages on error conditions. OK claudio@
2013-10-15Ignore messages that have Unknown flag set.Renato Westphal
OK claudio@
2013-07-04some very minor tweaking;Jason McIntyre
2013-06-05Fix build on vaxMiod Vallat
2013-06-04I screwed up and forgot to commit this new file :(Claudio Jeker
2013-06-04tweak previous;Jason McIntyre
2013-06-04Speed-up the session establishment processClaudio Jeker
* Send an extra Hello message before attempting to connect to a remote peer to guarantee that it formed an adjacency with us as well; * Don't wait for the first timeout to send the first Hello message. Both tricks together will allow for fast session establish since with both optimizations passive role neighbors can open the connection immediatly by sending and receiving the hellos at the same time as the TCP session. From Renato Westphal
2013-06-04Always accept TCP connection requests and identify to which neighborClaudio Jeker
it belongs only _after_ receiving an Initialization message containing the information we need. Before an Initialization message is received, the TCP connection shouldn't be associated with any neighbor/adjacency. Therefor refactor that part into a own module. From Renato Westphal
2013-06-04Tiny typo. "Just commit" -- claudio@Ian Darwin
2013-06-04Cleanup ctl commands and remove unused variables inherited from ospfdClaudio Jeker
From Renato Westphal
2013-06-04Implement support for adjacencies and targeted hellosClaudio Jeker
Refactor adjacencies out of the neighbor handling so that it is possible to have more complex topologies with targeted sessions. From Renato Westphal
2013-06-04Properly implement the exponential backoff timer on session initializationClaudio Jeker
According with the section 2.5.3 of RFC 5036, an LSR must throttle its session setup retry attempts with an exponential backoff in situations where Initialization messages are being NAK'd (because of disagreements on session parameters). It doesn't mention using this procedure for TCP connection failures. With that said, start the inactive delay timer only after receiving an appropriate notification message. When playing the active role of the initialization process, throttle the session setup retry attempts by not connecting to the remote peer. When playing the passive role, throttle the session setup retry attempts by delaying the processing of the received Initialization message. Diff by Renato Westphal, adjusted by myself
2013-06-04Minor adjustments in the initialization FSMClaudio Jeker
* Remove the unused NBR_EVT_DOWN event; * Print the FSM transitions before performing the appropriate actions. In this way nested calls to nbr_fsm() won't print the state transitions in reverse order; * When playing the active role of the initialization process, transition from NBA_STA_PRESENT to NBR_STA_INITIAL before going to NBR_STA_OPENSENT; * Call session_shutdown() on nbr_ktimeout() to remove duplicated code; * Notify the lde process when a neighbor is deleted (discovery timeout); * Fix a few memory leaks on nbr_del(). Diff from Renato Westphal.
2013-06-04Minor adjustments in the startup of the lde and ldpe processesClaudio Jeker
The 'ldpd_process' variable should be set as soon as possible in the initialization of each process. In that way if something goes wrong in the initialization we will know in which process the problem happened. Diff by Renato Westphal
2013-06-04fix some minor issues before proceeding with the remaining patches fromClaudio Jeker
Renato Westphal. Diff by Renato Westphal
2013-06-03Remove the IMSG_NEIGHBOR_CHANGE messageClaudio Jeker
Unlike OSPF, LDP has no concept of intermediate states. A session is either operational or not operational as far as the label distribution engine (lde) is concerned. In this case, the IMSG_NEIGHBOR_UP and IMSG_NEIGHBOR_DOWN messages are enough. Diff by Renato Westphal
2013-06-03Fix bug in the fib-update commandClaudio Jeker
The "fib-update" directive wasn't accepting "no" as an option. Diff by Renato Westphal
2013-06-03Advertise the implicit-null label for routes attached to loopbackClaudio Jeker
interfaces to guarantee PHP. With this 'fib-update no' is not totaly broken because of missing mappings for the loopbacks. Diff by Renato Westphal
2013-06-03Implement support for multiple addresses per interface.Claudio Jeker
This replaces the way addresses and interface are chained together. In ospfd there was a 1 to 1 mapping (with iface clones) but LDP does not have that limitation. Diff from Renato Westphal
2013-06-01Filter out route messages we don't need and log kernel messages inClaudio Jeker
super verbose mode. From Renato Westphal
2013-06-01zap extra .Pp;Jason McIntyre
2013-06-01Restart the keepalive timer whenever a LDP PDU is sent. There is no needClaudio Jeker
to send a keepalive packet when a other PDU was sent out. Also add a missing NBR_EVT_PDU_RCVD call to recv_address() which restarts the session keepalive timeout. All other places already do that. Diff by Renato Westphal
2013-06-01The keepalive timeout should be configured on a global basis and not perClaudio Jeker
interface. Remove the iface pointer from the 'nbr' structure because it's not needed anymore. Diff from Renato Westphal
2013-06-01Improve error handling on session_readClaudio Jeker
* Don't try to send a Shutdown message if the connection is already closed or a read error occured; * As per RFC 5036, send a Shutdown message if an unexpected message is received during the initialization process; * Check if the whole LSR ID of received messages is correct; * On ldpe_dispatch_main(), ignore the messages from the lde process whose associated neighbor is not in the operational state. Diff from Renato Westphal
2013-06-01Drop support for per-interface labelspaces.Claudio Jeker
Support for per-interface labelspaces is only necessary for legacy ATM/FR interfaces running in cell-mode. We shouldn't worry about this. For platform-wide label spaces the label space id is always 0. Diff by Renato Westphal
2013-06-01Drop support for passive interfaces.Claudio Jeker
Support for passive interfaces was inherited from ospfd but it doesn't make any sense at all for ldpd. Diff from Renato Westphal
2013-06-01A bit nicer error message.Claudio Jeker
2013-06-01Don't allow enabling LDP on loopback and carp interfaces.Claudio Jeker
LDP should be allowed only on physical or tunnel interfaces. Diff by Renato Westphal
2013-06-01Use the nbr_stop_[*]timer functionsClaudio Jeker
Diff from Renato Westphal
2013-06-01After sending a keepalive message in the OPENSENT state, we must move toClaudio Jeker
the OPENREC state and wait for a keepalive before considering the session as established Another bug fix by Renato Westphal
2013-06-01After returning from accept, we got a TCP connection not a LDP session.Claudio Jeker
Rename event/actions in the discovery FSM to avoid confusion * NBR_EVT_SESSION_UP -> NBR_EVT_CONNECT_UP * NBR_ACT_SESSION_EST -> NBR_ACT_CONNECT_SETUP * nbr_act_session_establish -> nbr_act_connect_setup * NBR_ACT_INIT_SEND -> NBR_ACT_PASSIVE_INIT * NBR_ACT_STRT_KTIMER -> NBR_ACT_SESSION_EST Diff by Renato Westphal
2013-06-01Don't set the Message ID for hello messages.Claudio Jeker
The Message ID field is used by notification messages to identify a given message. This is the behavior adopted by Cisco IOS. Diff from Renato Westphal
2013-06-01Always advertise the Router-ID as the transport address.Claudio Jeker
RFC 5036 - Section 2.5.2 says: An LSR MUST advertise the same transport address in all Hellos that advertise the same label space... To satisfy this condition, always advertise the Router-ID as the transport address by using the "IPv4 Transport Address" TLV in the generated Hello messages. From Renato Westphal
2013-05-31Remove unused definitionsClaudio Jeker
Diff from Renato Westphal [renatowestphal at gmail.com]
2013-05-31When the ldpe process calls connect(), it doesn't regain control untilClaudio Jeker
either the connection is made or an error occurs. The time the process is blocked can be significantly large to the point of other LDP sessions being torn down because of their holdtime. Besides that, the ldpctl program gets unresponsive if the ldpe process is blocked. Fix these issues by using a non-blocking connect. Diff from Renato Westphal [renatowestphal at gmail.com]
2013-05-30Fix bug when starting ldpd with a configured interface in the down state.Claudio Jeker
If a given interface is down at startup, don't promote it to the ACTIVE state. Diff from Renato Westphal [renatowestphal at gmail.com]