OpenBSD CVS

CVS log for src/usr.sbin/ldpd/init.c


[BACK] Up to [local] / src / usr.sbin / ldpd

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.37 / (download) - annotate - [select for diffs], Sat Mar 4 00:15:35 2017 UTC (7 years, 3 months ago) by renato
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6, OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1, HEAD
Changes since 1.36: +67 -2 lines
Diff to previous 1.36 (colored)

Implement RFC 5919 (LDP End-of-LIB).

Revision 1.36 / (download) - annotate - [select for diffs], Sat Mar 4 00:09:17 2017 UTC (7 years, 3 months ago) by renato
Branch: MAIN
Changes since 1.35: +68 -2 lines
Diff to previous 1.35 (colored)

Implement RFC 5918 (Typed Wildcard FEC).

Revision 1.35 / (download) - annotate - [select for diffs], Sat Mar 4 00:06:10 2017 UTC (7 years, 3 months ago) by renato
Branch: MAIN
Changes since 1.34: +148 -6 lines
Diff to previous 1.34 (colored)

Implement RFC 5561 (LDP Capabilities).

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).

Revision 1.34 / (download) - annotate - [select for diffs], Fri Mar 3 23:44:35 2017 UTC (7 years, 3 months ago) by renato
Branch: MAIN
Changes since 1.33: +2 -2 lines
Diff to previous 1.33 (colored)

Kill send_notification_nbr().

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.

Revision 1.33 / (download) - annotate - [select for diffs], Sat Jul 16 19:20:16 2016 UTC (7 years, 10 months ago) by renato
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0
Changes since 1.32: +36 -43 lines
Diff to previous 1.32 (colored)

Fix parsing of mal-formed optional TLVs/Sub-TLVs.

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.

Revision 1.32 / (download) - annotate - [select for diffs], Fri Jul 1 23:36:38 2016 UTC (7 years, 11 months ago) by renato
Branch: MAIN
Changes since 1.31: +15 -15 lines
Diff to previous 1.31 (colored)

More renaming and whitespace cleanup.

No binary change after "strip -s".

Revision 1.31 / (download) - annotate - [select for diffs], Fri Jul 1 23:29:55 2016 UTC (7 years, 11 months ago) by renato
Branch: MAIN
Changes since 1.30: +9 -9 lines
Diff to previous 1.30 (colored)

Several minor tweaks.

Revision 1.30 / (download) - annotate - [select for diffs], Mon Jun 27 19:06:33 2016 UTC (7 years, 11 months ago) by renato
Branch: MAIN
Changes since 1.29: +9 -4 lines
Diff to previous 1.29 (colored)

Handle ibuf_add() errors.

tweaks from claudio@

Revision 1.29 / (download) - annotate - [select for diffs], Sat Jun 11 01:55:35 2016 UTC (8 years ago) by renato
Branch: MAIN
Changes since 1.28: +12 -6 lines
Diff to previous 1.28 (colored)

Make all TLV parsing functions look the same for consistency.

Also, add one more safety check in recv_init().

Revision 1.28 / (download) - annotate - [select for diffs], Wed Jun 8 21:28:09 2016 UTC (8 years ago) by renato
Branch: MAIN
Changes since 1.27: +6 -3 lines
Diff to previous 1.27 (colored)

Add one more safety check for Initialization messages.

RFC 5036 says the following about the "Receiver LDP Identifier" field:
  "Identifies the receiver's label space.  This LDP Identifier, together
  with the sender's LDP Identifier in the PDU header, enables the receiver
  to match the Initialization message with one of its Hello adjacencies;

  If there is no matching Hello adjacency, the LSR MUST send a Session
  Rejected/No Hello Notification message in response to the Initialization
  message and not establish the session".

This is one more case of LDP being more complex than what it should have
been.  Since LDP support MPLS label spaces (for ATM and FR), just the
sender's LSR-ID in the PDU header is not enough for identifying an Hello
adjacency. We also need the receiver's label space, and that's what this
field gives us. In fact, this field contains the full receiver's LSR-ID,
but the IP part doesn't really matter.

Since we don't support label spaces (and never will), we were happily
ignoring this field. This patch changes this to fix some errors with ANVL.

Fixes the following ANVL LDP tests: 6.5, 6.6 and 6.11.

Revision 1.27 / (download) - annotate - [select for diffs], Mon May 23 19:11:42 2016 UTC (8 years ago) by renato
Branch: MAIN
Changes since 1.26: +2 -14 lines
Diff to previous 1.26 (colored)

Remove superfluous includes.

Revision 1.26 / (download) - annotate - [select for diffs], Mon May 23 19:09:25 2016 UTC (8 years ago) by renato
Branch: MAIN
Changes since 1.25: +5 -7 lines
Diff to previous 1.25 (colored)

Make functions and variables static whenever possible.

The benefits of this include:
* clean up of the ldpd global namespace;
* improved readability;
* more hints to the compiler/linker to generate more efficient code.

Whenever possible, move global static variables to a smaller scope
(function).

All extern variables are now declared in header files to avoid unnecessary
duplication.

This patch also cleans up the indentation of all function prototypes
and global variables.

Revision 1.25 / (download) - annotate - [select for diffs], Mon May 23 18:58:48 2016 UTC (8 years ago) by renato
Branch: MAIN
Changes since 1.24: +3 -3 lines
Diff to previous 1.24 (colored)

Add support for IPv6 (RFC 7552).

This includes:
* Full compliance to RFC 7552;
* Support for MD5 on LDPov6 sessions;
* Support for pseudowires over IPv6 LSPs (we're probably the world's
  first implementation doing this);
* Support for the IPv6 explicit-null label;
* Knob to specify the prefered address-family for TCP transport
  connections;
* Knob to use cisco non-compliant format to send and interpret the
  Dual-Stack capability TLV.

Revision 1.24 / (download) - annotate - [select for diffs], Mon May 23 17:43:42 2016 UTC (8 years ago) by renato
Branch: MAIN
Changes since 1.23: +20 -20 lines
Diff to previous 1.23 (colored)

Fix mess caused by my commit script.

I screwed up everything... trying to fix now.

Revision 1.23 / (download) - annotate - [select for diffs], Mon May 23 16:20:59 2016 UTC (8 years ago) by renato
Branch: MAIN
Changes since 1.22: +3 -3 lines
Diff to previous 1.22 (colored)

Standardize some log messages and fix some inconsistencies.

We were using several different names for the same thing in our log
messages: neighbor, neighbor ID, nbr ID and LSR ID.

Standardize to always use "lsr-id" to refer to a neighbor.

Also:
* Use log_warnx() instead of log_warn() when appropriate;
* Use fatal(x) instead of err(x) when appropriate;
* Fix some inconsistent log messages.

Revision 1.22 / (download) - annotate - [select for diffs], Mon May 23 16:14:36 2016 UTC (8 years ago) by renato
Branch: MAIN
Changes since 1.21: +3 -3 lines
Diff to previous 1.21 (colored)

More renaming.

Rename a few more things to improve readability.

* s/F_PW_CONTROLWORD_CONF/F_PW_CWORD_CONF/ (shorter)
* s/F_PW_CONTROLWORD/F_PW_CWORD/ (shorter)
* s/LDPD_FLAG_*/F_LDPD_*/ (consistency)
* s/lde_nbr_address/lde_addr/ (shorter)
* s/ldp_discovery_socket/ldp_disc_socket/ (shorter)
* s/ldp_ediscovery_socket/ldp_edisc_socket/ (shorter)
* s/ldp_sendboth/main_imsg_compose_both/ (consistency)
* s/cons/total/ (makes more sense)
* s/kaddr/ka/ (consistency with remaining code)
* Always use 'ln' for lde_nbrs (consistency)

Revision 1.21 / (download) - annotate - [select for diffs], Mon May 23 16:04:04 2016 UTC (8 years ago) by renato
Branch: MAIN
Changes since 1.20: +7 -13 lines
Diff to previous 1.20 (colored)

Improve the parser of TCP/session packets.

Add more safeguards against malformed packets and fix existing ones. Also,
rename a few variables and constants to match their real meaning. For
example, rename gen_msg_tlv() to gen_msg_hdr() because this function
generates an LDP header, not a TLV.

Finally, clean-up all the send_* functions so they all follow the same
pattern.

Revision 1.20 / (download) - annotate - [select for diffs], Mon May 23 16:01:59 2016 UTC (8 years ago) by renato
Branch: MAIN
Changes since 1.19: +12 -1 lines
Diff to previous 1.19 (colored)

Respect the received Max PDU Length field.

Revision 1.19 / (download) - annotate - [select for diffs], Mon May 23 15:59:55 2016 UTC (8 years ago) by renato
Branch: MAIN
Changes since 1.18: +2 -3 lines
Diff to previous 1.18 (colored)

Fix issue with the exponential backoff timer.

Do not start the exponential backoff timer when playing the passive role
of the session establishment process.

RFC 5036 - Section 2.5.3 says:
"The specific session establishment action that must be
delayed is the attempt to open the session transport connection by
the LSR playing the active role".

Revision 1.18 / (download) - annotate - [select for diffs], Mon May 23 15:43:11 2016 UTC (8 years ago) by renato
Branch: MAIN
Changes since 1.17: +3 -3 lines
Diff to previous 1.17 (colored)

Add knob to configure the transport address.

This will be especially important when we add support for IPv6, because
we'll not be able to use the router-id as the transport-address in
this case.

Revision 1.17 / (download) - annotate - [select for diffs], Mon May 23 15:41:04 2016 UTC (8 years ago) by renato
Branch: MAIN
Changes since 1.16: +4 -3 lines
Diff to previous 1.16 (colored)

Allow setting the session holdtime per neighbor.

Revision 1.16 / (download) - annotate - [select for diffs], Mon May 23 15:14:07 2016 UTC (8 years ago) by renato
Branch: MAIN
Changes since 1.15: +4 -4 lines
Diff to previous 1.15 (colored)

Replace manually written function names with __func__.

Revision 1.15 / (download) - annotate - [select for diffs], Sat Oct 25 03:23:49 2014 UTC (9 years, 7 months ago) by lteo
Branch: MAIN
CVS Tags: OPENBSD_5_9_BASE, OPENBSD_5_9, OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.14: +1 -2 lines
Diff to previous 1.14 (colored)

Remove unnecessary netinet/in_systm.h include.

ok millert@

Revision 1.14 / (download) - annotate - [select for diffs], Tue Oct 15 20:21:25 2013 UTC (10 years, 7 months ago) by renato
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.13: +2 -5 lines
Diff to previous 1.13 (colored)

Fix whitespace and other style issues.
OK claudio@

Revision 1.13 / (download) - annotate - [select for diffs], Tue Oct 15 19:59:52 2013 UTC (10 years, 7 months ago) by renato
Branch: MAIN
Changes since 1.12: +6 -1 lines
Diff to previous 1.12 (colored)

Improve parsing of LDP messages.
Add more sanity checks and send proper notification messages on error
conditions.
OK claudio@

Revision 1.12 / (download) - annotate - [select for diffs], Tue Jun 4 02:34:48 2013 UTC (11 years ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.11: +2 -2 lines
Diff to previous 1.11 (colored)

Always accept TCP connection requests and identify to which neighbor
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

Revision 1.11 / (download) - annotate - [select for diffs], Tue Jun 4 01:32:16 2013 UTC (11 years ago) by claudio
Branch: MAIN
Changes since 1.10: +3 -2 lines
Diff to previous 1.10 (colored)

Properly implement the exponential backoff timer on session initialization

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

Revision 1.10 / (download) - annotate - [select for diffs], Sat Jun 1 19:28:55 2013 UTC (11 years ago) by claudio
Branch: MAIN
Changes since 1.9: +6 -4 lines
Diff to previous 1.9 (colored)

The keepalive timeout should be configured on a global basis and not per
interface.
Remove the iface pointer from the 'nbr' structure because it's not
needed anymore.
Diff from Renato Westphal

Revision 1.9 / (download) - annotate - [select for diffs], Sat Jun 1 18:47:07 2013 UTC (11 years ago) by claudio
Branch: MAIN
Changes since 1.8: +2 -3 lines
Diff to previous 1.8 (colored)

Drop support for per-interface labelspaces.
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

Revision 1.8 / (download) - annotate - [select for diffs], Sat Jun 1 18:35:02 2013 UTC (11 years ago) by claudio
Branch: MAIN
Changes since 1.7: +1 -4 lines
Diff to previous 1.7 (colored)

Drop support for passive interfaces.
Support for passive interfaces was inherited from ospfd but it doesn't
make any sense at all for ldpd.
Diff from Renato Westphal

Revision 1.7 / (download) - annotate - [select for diffs], Mon Jan 10 12:02:48 2011 UTC (13 years, 5 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.6: +42 -3 lines
Diff to previous 1.6 (colored)

Implement optional parameter handling for initialization messages.
This will now correctly ignore TLV with U flag set -- like the FT
extension used by JunOS. The function is built after
tlv_decode_opt_hello_prms().
Problem reported and fix tested by Marcel Wiget.

Revision 1.6 / (download) - annotate - [select for diffs], Thu Nov 4 09:52:16 2010 UTC (13 years, 7 months ago) by claudio
Branch: MAIN
Changes since 1.5: +17 -16 lines
Diff to previous 1.5 (colored)

Rewrite all packet parsers to be more careful about alignment. Until
now ldpd had no chance to run on a strict alignment architecture but
this makes ldpd happy on sparc64. Be careful to do all needed overflow
checks and try to make all parsing functions look similar.
OK michele@

Revision 1.5 / (download) - annotate - [select for diffs], Wed May 26 13:56:07 2010 UTC (14 years ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.4: +6 -6 lines
Diff to previous 1.4 (colored)

Rename some imsg bits to make namespace collisions less likely buf to
ibuf, buf_read to ibuf_read, READ_BUF_SIZE to IBUF_READ_SIZE.

ok henning gilles claudio jacekm deraadt

Revision 1.4 / (download) - annotate - [select for diffs], Thu Feb 25 17:40:46 2010 UTC (14 years, 3 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.3: +2 -3 lines
Diff to previous 1.3 (colored)

Do not use bufferevent for something that's already covered in the imsg
buffer API. This fixes a few possible problems in session_read and does
some further cleanup in various places. Wrap msgbuf into evbuf to add
libevent functionality and use buf_read to handle the read side of a
session.  OK michele@ and dlg@ did not see anything evil

Revision 1.3 / (download) - annotate - [select for diffs], Sat Feb 20 21:28:39 2010 UTC (14 years, 3 months ago) by michele
Branch: MAIN
Changes since 1.2: +3 -5 lines
Diff to previous 1.2 (colored)

Make send_* functions return void (and not int) as they can just succeed
or fatal().

ok claudio@

Revision 1.2 / (download) - annotate - [select for diffs], Fri Jun 5 22:34:45 2009 UTC (15 years ago) by michele
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.1: +3 -6 lines
Diff to previous 1.1 (colored)

Correctly send notification messages when errors occur.

ok claudio@ laurent@

Revision 1.1 / (download) - annotate - [select for diffs], Mon Jun 1 20:59:45 2009 UTC (15 years ago) by michele
Branch: MAIN

Welcome ldpd, the Label Distribution Protocol daemon.
Built using the imsg/three process framework, its main aim
is to redistribute MPLS labels between peers.

Right now it has some really basic functionalities,
the basic protocol works and peers are able to exchange
labels and insert them in the kernel.
It still does not react to changes of topology.

Not yet connected to the builds.

ok claudio@ deraadt@

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.