summaryrefslogtreecommitdiff
path: root/usr.sbin/ldpd
AgeCommit message (Collapse)Author
2018-07-11Do for most running out of memory err() what was done for most runningKenneth R Westerback
out of memory log_warn(). i.e. ("%s", __func__) instead of manual function names and redundant verbiage about which wrapper detected the out of memory condition. ok henning@
2018-07-09No need to mention which memory allocation entry point failed (malloc,Kenneth R Westerback
calloc or strdup), we just need to log that we ran out of memory in a particular function. Recommended by florian@ and deraadt@ ok benno@ henning@ tb@
2018-06-18remove the SECTIONS header, since a one line DESCRIPTION is a bit silly;Jason McIntyre
use a more general text for the sections, and avoid the catchup issue that was trying to document how many there were; ok benno rob
2018-06-11Fix an off-by-one line count when using include statements.denis
Thanks to otto@ for the initial diff. OK benno@
2018-04-26Plug leak in error case of the common 'varset' implementations.Kenneth R Westerback
ok benno@
2018-02-08Bump the read sockbuf of the routing socket to 2MB, may help reduce some ofClaudio Jeker
the desync cases. OK benno@
2018-01-03Add support for IPv6 over MPLS pseudowire aka mpw(4)denis
OK claudio@ jca@
2017-07-24Unify ROUNDUP macros for parsing route messages.friehm
Use the macro from route(8) / ospf6d(8) since it works also with argument 0. OK claudio@
2017-04-18use freezero()Theo de Raadt
2017-03-21From a syslog perspective it does not make sense to log fatal andAlexander Bluhm
warn with the same severity. Switch log_warn() to LOG_ERR and keep fatal() at LOG_CRIT. OK reyk@ florian@
2017-03-04Send VPLS MAC withdrawals.Renato Westphal
RFC 4762 says that MAC address withdrawal messages can be used to improve convergence time in VPLS networks. This patch makes ldpd send MAC withdrawals whenever a non-pseudowire interface pertaining to a VPLS goes down. The processing of received MAC withdrawals will be implemented later.
2017-03-04Fix parsing of optional tlvs in address messages.Renato Westphal
We were aborting the session upon receipt of MAC Address Withdrawal messages. Now make the parser aware that optional TLVs are possible in address messages.
2017-03-04Implement RFC 5919 (LDP End-of-LIB).Renato Westphal
2017-03-04Implement RFC 6667 (Typed Wildcard FEC for PWid).Renato Westphal
2017-03-04Implement RFC 5918 (Typed Wildcard FEC).Renato Westphal
2017-03-04Implement RFC 5561 (LDP Capabilities).Renato Westphal
This patch per-se doesn't introduce any useful functionality, but prepares the ground for new enhancements to ldpd (i.e. implementation of new RFCs that make use of LDP capabilities).
2017-03-04Implement support for PWid group wildcards.Renato Westphal
This was missing from our original RFC 4447 VPLS implementation. Now ldpd understands group wildcards as mandated by the RFC, but we still don't send them ourselves. I can't see any case in which sending a group wildcard would be useful, but nonetheless this patch provides a function called lde_send_labelwithdraw_pwid_wcard() which is ready to be used in the future anytime we feel like it might be useful.
2017-03-03Fix processing of Label Withdraw messages.Renato Westphal
Whenever we receive a Label Withdraw message with an optional Label TLV, we should check if this label matches the label previously received from this neighbor for this FEC. If they don't match then we shouldn't uninstall the previous label from the kernel. This fixes a misinterpretation from the "Receive Label Withdraw" algorithm described in the A.1.5 section of RFC 5036. Also, simplify the check of pending withdraws in lde_check_release() and lde_check_release_wcard().
2017-03-03The PW Status is an unknown TLV.Renato Westphal
Without this fix, any LDP speaker that doesn't implement RFC 4447 will shut down the session upon receipt of a PWid Label Mapping (unless the use of the PW-Status TLV is disabled via configuration).
2017-03-03Send correct status code on error condition.Renato Westphal
The Unknown TLV status code is reserved for cases where we don't know how to process a given TLV and its Unknown TLV bit is not set. In the case of Address Messages, the Address List TLV is mandatory and should appear before any optional TLV in the message. If that doesn't happen the correct status notification to send is "Missing Message Parameters" (non-fatal error). Also, add a missing htons when creating an Address List TLV. Since the value of TLV_TYPE_ADDRLIST is 0x0101 this missing htons wasn't noticed earlier.
2017-03-03Create helper functions to log sent/received messages.Renato Westphal
2017-03-03Provide more detailed output when logging notification messages.Renato Westphal
2017-03-03Kill send_notification_nbr().Renato Westphal
Be more clever and trigger the PDU SENT event inside send_notification() when tcp->nbr is set. This way we can eliminate send_notification_nbr() and always use send_notification() instead.
2017-03-03Minor tweaks.Renato Westphal
2017-03-03Allow to run on a non-default rdomain.Renato Westphal
OK claudio@
2017-03-03Allow to specify an alternate control socket.Renato Westphal
This is required to run multiple instances of ldpd. OK claudio@
2017-01-20work on making log.c similar in all daemons:Sebastian Benoit
move daemon-local functions into new logmsg.c, and reduce the (mostly whitespace) differences so that log.c's can be diffed easily. removal of log_rtmsg() aproved by claudio@ ok claudio@ krw@
2017-01-08Replace hand-rolled for(;;) traversal of ctl_conns TAILQ withKenneth R Westerback
TAILQ_FOREACH(). No intentional functional change. ok reyk@
2017-01-05Replace hand-rolled for(;;) emptying of 'symhead' TAILQ with moreKenneth R Westerback
modern TAILQ_FOREACH_SAFE(). No intentional functional change. ok millert@ bluhm@ gilles@
2017-01-05Replace symset()'s hand-rolled for(;;) traversal of 'symhead' TAILQKenneth R Westerback
with more modern TAILQ_FOREACH(). This what symget() was already doing. Add paranoia '{}' around body of symget()'s TAILQ_FOREACH(). No intentional functional change. ok bluhm@ otto@
2016-09-28'unneded stuff' -> 'unneeded stuff' in comments.Kenneth R Westerback
2016-09-03Rework the sending of address messages.Renato Westphal
* Respect the session's negotiated maximum pdu length and split the sending of our local addresses into multiple messages if necessary; * Log sent/received addresses; * Add new wrappers to send only one address (send_address_single) and to send all addresses of the given address-family (send_address_all). These wrappers create a temporary list of addresses to be sent, and send_address() then acts on this last.
2016-09-02Fix small memleak on error path.Renato Westphal
2016-09-02lde() and ldpe() should return void.Renato Westphal
Remove these leftovers from the pre-fork+exec era. Spotted by and ok rzalamena@ ok claudio@
2016-09-02Improve logging of sent and received messages.Renato Westphal
* Standardize the logging format of sent and received messages: "msg-[in|out]: message type: lsr-id A.B.C.D [additional info]"; * Log sent label messages as well, not only the received ones; * Move the logging of sent notification messages from send_notification_nbr() to send_notification_full(), this way notification triggered by the lde process are logged as well; * Minor clean-up.
2016-09-02Reevaluate received mappings upon receipt of address message.Renato Westphal
If a neighbor was a nexthop for a given set of prefixes but it's not anymore, then we should uninstall the associated label mappings (if any) from the kernel. The same applies for the other way round (neighbor wasn't a nexthop for a given set of prefixes but now is). This issue is only evident when we have multiple links between a pair of LSRs. Generally, when a link is shut down, the whole LDP is torn down and all label mappings uninstalled automatically. ok claudio@
2016-09-02Simplify shutdown process.Renato Westphal
On shutdown, there's no need to use kill(2) to kill the child processes. Just closing the IPC sockets will make the children receive an EOF, break out from the event loop and then exit. Tha advantages of this "pipe teardown" are: * simpler code; * no need to pledge "proc" in the parent process; * removal of a (hard to trigger) PID reuse race condition. ok claudio@
2016-08-08Use exit(3) instead of _exit(2) in the child processes.Renato Westphal
Since recently the child processes call exec() after fork(), so they should stop using _exit(2) and use exit(3) instead when shutting down. Ok claudio@
2016-08-08Normalize the received prefixes.Renato Westphal
We need to use ldp_applymask() to normalize the received prefixes. Example: 10.1.1.0/16 -> 10.1.0.0/16. Additionally, stop using IANA's AF numbers in map->fec.prefix.af and use AF_INET/AF_INET6 instead. This makes the code much simpler, use AF_IPV[46] only when necessary (decoding/encoding prefixes). ok claudio@
2016-07-18add format attributes to log functions and fix am error when usingSebastian Benoit
log_warnx() ok renato@ claudio@
2016-07-16Remove potential overflow when validating message's length.Renato Westphal
Also, use uint16_t for msg_type on gen_msg_hdr().
2016-07-16Fix parsing of mal-formed optional TLVs/Sub-TLVs.Renato Westphal
We must detect if a TLV's length extends beyond the end of the containing message. And, if so, send a fatal "Bad TLV Length" notification message. Found with the Mu Dynamics Mu-8000 protocol fuzzer.
2016-07-15Improve logging of reserved labels.Renato Westphal
Print "exp-null" and "imp-null" instead of "0" and "3", for example. Also, remove print_label() and print_pw_type() from ldpctl.c and use the equivalent functions from ldpd's log.c. While here, be more paranoid and use UINT32_MAX instead of UINT_MAX for NO_LABEL.
2016-07-15Explicitly ignore the Hop Count and Path Vector TLVs.Renato Westphal
Since these are "well known" TLVs, we have to explicitly ignore them otherwise ldpd would send "Unknown TLV" Notification messages when it shouldn't. Fixes regression caused by rev1.51.
2016-07-15Update per-neighbor GTSM options on config reload.Renato Westphal
2016-07-07Updated the ldpd.conf man page examplesRafael Zalamena
The man page already contains the definition of the new neighbor-addr and neighbor-id, but the examples were outdated. Now we may have an LSR-ID that is different from its address. ok renato@
2016-07-02do not uppercase "hop limit";Jason McIntyre
2016-07-01More renaming and whitespace cleanup.Renato Westphal
No binary change after "strip -s".
2016-07-01Be more compliant with RFC 4447.Renato Westphal
When sending a label withdraw during the pseudowire Control Word negotiation, append a "Wrong C-bit" status TLV after the FEC TLV (in conformance to RFC 4447 section 6.2). Apparently this has no use other than aiding in troubleshooting. Also, extend the recv_labelmessage() function to accept Status TLVs and ignore them instead of shutting down the session.
2016-07-01Several minor tweaks.Renato Westphal