OpenBSD CVS

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


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.78 / (download) - annotate - [select for diffs], Tue Apr 23 13:34:51 2024 UTC (5 weeks, 4 days ago) by jsg
Branch: MAIN
CVS Tags: HEAD
Changes since 1.77: +2 -2 lines
Diff to previous 1.77 (colored)

correct indentation; no functional change
ok tb@

Revision 1.77 / (download) - annotate - [select for diffs], Thu Dec 14 11:10:19 2023 UTC (5 months, 2 weeks ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5
Changes since 1.76: +2 -2 lines
Diff to previous 1.76 (colored)

Use imsg_get_fd() to access the file descriptor passed in the imsg.
OK tb@

Revision 1.76 / (download) - annotate - [select for diffs], Wed Mar 8 04:43:13 2023 UTC (14 months, 3 weeks ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3
Changes since 1.75: +1 -4 lines
Diff to previous 1.75 (colored)

Delete obsolete /* ARGSUSED */ lint comments.

ok miod@ millert@

Revision 1.75 / (download) - annotate - [select for diffs], Tue Jan 19 15:23:25 2021 UTC (3 years, 4 months ago) by claudio
Branch: MAIN
CVS Tags: 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
Changes since 1.74: +2 -2 lines
Diff to previous 1.74 (colored)

Kill log_procnames and properly define ldpd_process.

Revision 1.74 / (download) - annotate - [select for diffs], Wed Jan 23 02:02:04 2019 UTC (5 years, 4 months ago) by dlg
Branch: MAIN
CVS Tags: 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
Changes since 1.73: +14 -1 lines
Diff to previous 1.73 (colored)

rework how tcp md5 signatures are configured.

previously ldpd only allowed tcp md5 to be configured against a
neighbor (by ldp router id), but other vendors supported configuring
tcp md5sig by prefix as well as neighbor. this reworks the config
so auth is maintained globally as a list of prefixes that you do
and do not want to do tcp md5sig auth with.

the config statements look more like what is in bgpd.conf now too.

an example of the new config for interoperating with my baby cisco
test network:

on ios:

	mpls ldp password required for MPLS
	mpls ldp password option 1 for MPLS key-chain LDPAUTH

	key chain LDPAUTH
	 key 1
	  key-string secret

	interface Loopback0
	 ip address 192.168.0.0 255.255.255.255
	end

	ip prefix-list MPLS seq 5 permit 192.168.0.0/24
	ip access-list standard MPLS

	mpls ldp router-id Loopback0 force

and in ldpd.conf:

	router-id 192.168.0.25
	tcp md5sig password secret 192.168.0.0/24
	address-family ipv4 { interface vmx1 }

this still supports specifying tcp md5sig on neighbors, but that
is syntactic sugar around adding entries to the list of auths.

ok (and lots of help from) claudio@

Revision 1.73 / (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_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
Changes since 1.72: +41 -1 lines
Diff to previous 1.72 (colored)

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

Revision 1.72 / (download) - annotate - [select for diffs], Sat Mar 4 00:12:26 2017 UTC (7 years, 3 months ago) by renato
Branch: MAIN
Changes since 1.71: +15 -1 lines
Diff to previous 1.71 (colored)

Implement RFC 6667 (Typed Wildcard FEC for PWid).

Revision 1.71 / (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.70: +15 -1 lines
Diff to previous 1.70 (colored)

Implement RFC 5918 (Typed Wildcard FEC).

Revision 1.70 / (download) - annotate - [select for diffs], Sat Mar 4 00:03:04 2017 UTC (7 years, 3 months ago) by renato
Branch: MAIN
Changes since 1.69: +42 -31 lines
Diff to previous 1.69 (colored)

Implement support for PWid group wildcards.

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.

Revision 1.69 / (download) - annotate - [select for diffs], Fri Mar 3 23:41:27 2017 UTC (7 years, 3 months ago) by renato
Branch: MAIN
Changes since 1.68: +4 -4 lines
Diff to previous 1.68 (colored)

Minor tweaks.

Revision 1.68 / (download) - annotate - [select for diffs], Fri Jan 20 12:19:18 2017 UTC (7 years, 4 months ago) by benno
Branch: MAIN
Changes since 1.67: +2 -1 lines
Diff to previous 1.67 (colored)

work on making log.c similar in all daemons:

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@

Revision 1.67 / (download) - annotate - [select for diffs], Fri Sep 2 17:10:34 2016 UTC (7 years, 9 months ago) by renato
Branch: MAIN
Changes since 1.66: +2 -5 lines
Diff to previous 1.66 (colored)

lde() and ldpe() should return void.

Remove these leftovers from the pre-fork+exec era.

Spotted by and ok rzalamena@ ok claudio@

Revision 1.66 / (download) - annotate - [select for diffs], Fri Sep 2 17:05:23 2016 UTC (7 years, 9 months ago) by renato
Branch: MAIN
Changes since 1.65: +50 -1 lines
Diff to previous 1.65 (colored)

Reevaluate received mappings upon receipt of address message.

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@

Revision 1.65 / (download) - annotate - [select for diffs], Fri Sep 2 17:03:24 2016 UTC (7 years, 9 months ago) by renato
Branch: MAIN
Changes since 1.64: +9 -5 lines
Diff to previous 1.64 (colored)

Simplify shutdown process.

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@

Revision 1.64 / (download) - annotate - [select for diffs], Mon Aug 8 21:42:13 2016 UTC (7 years, 9 months ago) by renato
Branch: MAIN
Changes since 1.63: +2 -2 lines
Diff to previous 1.63 (colored)

Use exit(3) instead of _exit(2) in the child processes.

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@

Revision 1.63 / (download) - annotate - [select for diffs], Mon Aug 8 16:45:51 2016 UTC (7 years, 9 months ago) by renato
Branch: MAIN
Changes since 1.62: +5 -5 lines
Diff to previous 1.62 (colored)

Normalize the received prefixes.

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@

Revision 1.62 / (download) - annotate - [select for diffs], Mon Jul 18 21:10:37 2016 UTC (7 years, 10 months ago) by benno
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0
Changes since 1.61: +2 -2 lines
Diff to previous 1.61 (colored)

add format attributes to log functions and fix am error when using
log_warnx()

ok renato@ claudio@

Revision 1.61 / (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.60: +14 -14 lines
Diff to previous 1.60 (colored)

More renaming and whitespace cleanup.

No binary change after "strip -s".

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

Be more compliant with RFC 4447.

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.

Revision 1.59 / (download) - annotate - [select for diffs], Sat Jun 18 01:25:53 2016 UTC (7 years, 11 months ago) by renato
Branch: MAIN
Changes since 1.58: +8 -3 lines
Diff to previous 1.58 (colored)

Fix small LIB<->LFIB synchronization issue.

ldpd operates only with the best routes of each IP prefix. In other words,
the routes with the lowest priorities.

When a route with a better priority is detected (possibly with a different
nexthop), we should uninstall the labels from the "old" routes and try
to install a new label for the new route (if there's one available in
the LIB).

In this specific case, ldpd was failing to uninstall the labels from the
old routes because it wasn't keeping track of each route's priority in
lde. With this missing bit of information, the parent process had no way
to get the correct label to uninstall when processing a IMSG_KLABEL_DELETE
message.

Revision 1.58 / (download) - annotate - [select for diffs], Mon May 23 19:16:00 2016 UTC (8 years ago) by renato
Branch: MAIN
Changes since 1.57: +30 -38 lines
Diff to previous 1.57 (colored)

Improve security by calling exec after fork.

For each child process (lde and ldpe), re-exec ldpd with a special
"per-role" getopt flag. This way we have seperate ASLR/cookies per
process.

Based on a similar patch for bgpd, from claudio@

Requested by deraadt@

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

Update copyright information.

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

Remove superfluous includes.

Revision 1.55 / (download) - annotate - [select for diffs], Mon May 23 19:09:25 2016 UTC (8 years ago) by renato
Branch: MAIN
Changes since 1.54: +35 -35 lines
Diff to previous 1.54 (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.54 / (download) - annotate - [select for diffs], Mon May 23 18:58:48 2016 UTC (8 years ago) by renato
Branch: MAIN
Changes since 1.53: +189 -68 lines
Diff to previous 1.53 (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.53 / (download) - annotate - [select for diffs], Mon May 23 18:55:21 2016 UTC (8 years ago) by renato
Branch: MAIN
Changes since 1.52: +20 -32 lines
Diff to previous 1.52 (colored)

Assorted fixes and small cleanup.

Nothing really interesting here.

Revision 1.52 / (download) - annotate - [select for diffs], Mon May 23 18:46:13 2016 UTC (8 years ago) by renato
Branch: MAIN
Changes since 1.51: +6 -1 lines
Diff to previous 1.51 (colored)

Introduce a garbage collector for dead entries in the LIB.

If we lose a route and all of its associated labels, then there's no
point on keeping an entry for it in the LIB.

Revision 1.51 / (download) - annotate - [select for diffs], Mon May 23 18:31:12 2016 UTC (8 years ago) by renato
Branch: MAIN
Changes since 1.50: +8 -4 lines
Diff to previous 1.50 (colored)

Fix bugs in pseudowire parameters negotiation.

Revision 1.50 / (download) - annotate - [select for diffs], Mon May 23 18:28:22 2016 UTC (8 years ago) by renato
Branch: MAIN
Changes since 1.49: +13 -13 lines
Diff to previous 1.49 (colored)

Copy structs by assignment instead of memcpy.

Copying by straight assignment is shorter, easier to read and has a
higher level of abstraction. We'll only avoid it when copying from an
unaligned source (e.g., network buffers).

In addition, copy in_addr structs directly.

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

Fix mess caused by my commit script.

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

Revision 1.48 / (download) - annotate - [select for diffs], Mon May 23 16:54:22 2016 UTC (8 years ago) by renato
Branch: MAIN
Changes since 1.47: +46 -26 lines
Diff to previous 1.47 (colored)

Rework L2VPN code.

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

Remove protection that was prevent pseudowires to be updated in the kernel.

During the setup of a pseudowire, it might change its parameters
(e.g. control-word) once the negotiation with the remote peer is done.

Revision 1.46 / (download) - annotate - [select for diffs], Mon May 23 16:43:57 2016 UTC (8 years ago) by renato
Branch: MAIN
Changes since 1.45: +4 -6 lines
Diff to previous 1.45 (colored)

Make send_labelmessage() more robust.

Immediately return from this function if the given list of mappings
is empty. This way we have more freedom when sending label messages,
not having to care with corner cases.

Revision 1.45 / (download) - annotate - [select for diffs], Mon May 23 16:20:59 2016 UTC (8 years ago) by renato
Branch: MAIN
Changes since 1.44: +7 -7 lines
Diff to previous 1.44 (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.44 / (download) - annotate - [select for diffs], Mon May 23 16:14:36 2016 UTC (8 years ago) by renato
Branch: MAIN
Changes since 1.43: +61 -61 lines
Diff to previous 1.43 (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.43 / (download) - annotate - [select for diffs], Mon May 23 16:12:28 2016 UTC (8 years ago) by renato
Branch: MAIN
Changes since 1.42: +7 -7 lines
Diff to previous 1.42 (colored)

Rename a few constants to avoid confusion.

In ldpd we have the map structure, which is used to represent a label message,
and the fec structure, used to store FECs in the LIB.

As of now, ldpd supports two type of FECs:
* IPv4 prefix (FEC_TYPE_IPV4);
* PWID (FEC_TYPE_PWID).

For the label messages, the following contants were being used:
* FEC_WILDCARD;
* FEC_PREFIX (IPv4 or IPv6);
* FEC_PWID.

Since these contants have similar names to the previous ones, rename
them to:
* MAP_TYPE_WILDCARD;
* MAP_TYPE_PREFIX;
* MAP_TYPE_PWID.

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

Move some code around.

This patch doesn't introduce any logical change.

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

Replace manually written function names with __func__.

Revision 1.40 / (download) - annotate - [select for diffs], Sat Dec 5 13:11:48 2015 UTC (8 years, 5 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.39: +5 -5 lines
Diff to previous 1.39 (colored)

EAGAIN handling for imsg_read. OK henning@ benno@

Revision 1.39 / (download) - annotate - [select for diffs], Fri Oct 23 10:10:17 2015 UTC (8 years, 7 months ago) by renato
Branch: MAIN
Changes since 1.38: +4 -1 lines
Diff to previous 1.38 (colored)

Add pledge(2) to the child processes.

This is almost identical to the eigrpd(8) pledge diff, with the exception
that the parent process can not be pledged bacause of a SIOCSETMPWCFG
ioctl used to configure pseudowires.

Looks good to deraadt@.

Revision 1.38 / (download) - annotate - [select for diffs], Tue Jul 21 04:52:29 2015 UTC (8 years, 10 months ago) by renato
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.37: +261 -38 lines
Diff to previous 1.37 (colored)

VPLS signaling support.

This patch introduces full support for pseudowire signaling in ldpd(8),
including Control Word and Status TLV negotiation.

As of now it's not possible to configure a VPWS, but the signaling is
the same. In the future, when VPWS support is available in the kernel,
ldpd(8) can be extended to support VPWS with only a few modifications.

Limitations:
* No support for FEC 129, only FEC 128 (more widely deployed);
* No support for group withdraws (not widely deployed);
* No support for MAC withdraws (not widely deployed).

Related RFCs:
* RFC 3916: Requirements for Pseudo-Wire Emulation Edge-to-Edge (PWE3)
* RFC 3985: Pseudo Wire Emulation Edge-to-Edge (PWE3) Architecture
* RFC 4385: Pseudowire Emulation Edge-to-Edge (PWE3) Control Word for
  Use over an MPLS PSN
* RFC 4446: IANA Allocations for Pseudowire Edge to Edge Emulation (PWE3)
* RFC 4447: Pseudowire Setup and Maintenance Using the Label Distribution
  Protocol (LDP)
* RFC 4448: Encapsulation Methods for Transport of Ethernet over MPLS
  Networks
* RFC 4905: Encapsulation Methods for Transport of Layer 2 Frames over
  MPLS Networks
* RFC 4906: Transport of Layer 2 Frames Over MPLS

ok claudio@

Revision 1.37 / (download) - annotate - [select for diffs], Tue Jul 21 04:48:42 2015 UTC (8 years, 10 months ago) by renato
Branch: MAIN
Changes since 1.36: +2 -2 lines
Diff to previous 1.36 (colored)

Record all fields of the received label mappings.

Since we implement the Liberal Label Retention mode, we need to record
all fields of the received label mappings so the messages can be processed
later when there is a matching nexthop for the advertised FECs.

This will be important when we implement VPLS because we need to retain
information like the pseudowire's interface MTU and Group ID.

ok claudio@

Revision 1.36 / (download) - annotate - [select for diffs], Tue Jul 21 04:46:51 2015 UTC (8 years, 10 months ago) by renato
Branch: MAIN
Changes since 1.35: +55 -55 lines
Diff to previous 1.35 (colored)

Rename structures and functions to be more generic.

LDP work with FECs, where a FEC can be a prefix, a pseudowire and so on.

ok claudio@

Revision 1.35 / (download) - annotate - [select for diffs], Tue Jul 21 04:45:21 2015 UTC (8 years, 10 months ago) by renato
Branch: MAIN
Changes since 1.34: +3 -2 lines
Diff to previous 1.34 (colored)

Reuse merge_config() logic to simplify the shutdown of each process.

ok claudio@

Revision 1.34 / (download) - annotate - [select for diffs], Tue Jul 21 04:43:28 2015 UTC (8 years, 10 months ago) by renato
Branch: MAIN
Changes since 1.33: +32 -1 lines
Diff to previous 1.33 (colored)

Add configuration reload support.

ok claudio@

Revision 1.33 / (download) - annotate - [select for diffs], Sun Jul 19 20:54:16 2015 UTC (8 years, 10 months ago) by renato
Branch: MAIN
Changes since 1.32: +93 -72 lines
Diff to previous 1.32 (colored)

Rework label mapping algorithms to be more in line with the RFC.

This patch presents a thoroughly review of the label mapping
algorithms. Most of the changes are minor bug fixes in the handling of
received label messages.

Additional improvements:
* Add a few more references to the Appendix A of the RFC5036 ("LDP
  Label Distribution Procedures") into the code;
* Add full multipath support;
* Send label withdraws when appropriate;
* Add label withdraw/release wildcard support.

NOTE: As a result of implementing only the "Liberal Label Retention" and
"Downstream Unsolicited" modes, we will never send a label request
("Request  Never"). And that means that we can ignore the following
notification messages: "Label Request Aborted", "No Label Resources",
"No Route" and "Label Resources Available". The following algorithms
mentioned in the RFC can also be ignored: "Timeout of Deferred Label
Request", "Detect Local Label Resources Have Become Available" and
"Receive Label Abort Request".

Now, considering that we only support one combination of all modes of
operation, we can say that we have an almost complete implementation of
the protocol.

ok claudio@

Revision 1.32 / (download) - annotate - [select for diffs], Sun Jul 19 20:50:03 2015 UTC (8 years, 10 months ago) by renato
Branch: MAIN
Changes since 1.31: +1 -7 lines
Diff to previous 1.31 (colored)

Remove incomplete support for unnecessary modes of  operation.

LDP has several modes of operation, it was designed in that way so it
could run on legacy equipment like ATM/FR switches with very strict
memory limitations.

For modern hardware there's no point on using either the "Conservative
Label Retention" or "Downstream On Demand" modes of operation since they
save memory at cost of blackholing traffic when routing changes. Major
vendors implement only the "Liberal Label Retention" and "Downstream
Unsolicited" modes for non ATM/FR hardware. Let's do that too.

As for using either "Independent Control" or "Ordered Control", let's
stick with the first option mainly because it's easier to implement
and because it doesn't really matter which control mode is used. For
reference, Cisco implements only "Independent Control" and Juniper only
"Ordered Control". Both modes are interoperable.

The point of supporting only one combination of all modes of operation
is that it will allow for the writing of a simpler code without removing
useful functionality.

ok claudio@

Revision 1.31 / (download) - annotate - [select for diffs], Sun Jul 19 18:34:32 2015 UTC (8 years, 10 months ago) by renato
Branch: MAIN
Changes since 1.30: +17 -1 lines
Diff to previous 1.30 (colored)

Uninstall associated label bindings when a neighbor is down.

ok claudio@

Revision 1.30 / (download) - annotate - [select for diffs], Sat Mar 21 18:34:01 2015 UTC (9 years, 2 months ago) by renato
Branch: MAIN
Changes since 1.29: +1 -6 lines
Diff to previous 1.29 (colored)

Remove unused variables and functions.

Revision 1.29 / (download) - annotate - [select for diffs], Sat Jul 12 20:16:38 2014 UTC (9 years, 10 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7, OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.28: +7 -3 lines
Diff to previous 1.28 (colored)

Close connections when msgbuf_write() returns 0.

ok claudio@

Revision 1.28 / (download) - annotate - [select for diffs], Tue Nov 26 11:59:38 2013 UTC (10 years, 6 months ago) by henning
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.27: +2 -2 lines
Diff to previous 1.27 (colored)

deal with msgbuf_write EAGAIN, ok gilles benno

Revision 1.27 / (download) - annotate - [select for diffs], Tue Oct 15 20:36:30 2013 UTC (10 years, 7 months ago) by renato
Branch: MAIN
Changes since 1.26: +8 -8 lines
Diff to previous 1.26 (colored)

Simplify the lde_nbr_new() function.

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@

Revision 1.26 / (download) - annotate - [select for diffs], Tue Oct 15 20:34:02 2013 UTC (10 years, 7 months ago) by renato
Branch: MAIN
Changes since 1.25: +27 -22 lines
Diff to previous 1.25 (colored)

Simplify the code by avoiding direct calls to imsg_compose_event().
OK claudio@

Revision 1.25 / (download) - annotate - [select for diffs], Tue Oct 15 20:21:25 2013 UTC (10 years, 7 months ago) by renato
Branch: MAIN
Changes since 1.24: +3 -3 lines
Diff to previous 1.24 (colored)

Fix whitespace and other style issues.
OK claudio@

Revision 1.24 / (download) - annotate - [select for diffs], Tue Jun 4 00:45:00 2013 UTC (11 years ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.23: +4 -4 lines
Diff to previous 1.23 (colored)

Minor adjustments in the startup of the lde and ldpe processes
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

Revision 1.23 / (download) - annotate - [select for diffs], Mon Jun 3 17:01:59 2013 UTC (11 years ago) by claudio
Branch: MAIN
Changes since 1.22: +2 -16 lines
Diff to previous 1.22 (colored)

Remove the IMSG_NEIGHBOR_CHANGE message
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

Revision 1.22 / (download) - annotate - [select for diffs], Tue Oct 26 12:08:14 2010 UTC (13 years, 7 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.21: +119 -51 lines
Diff to previous 1.21 (colored)

Change lde_check_request(), lde_check_mapping(), lde_send_labelmapping(),
lde_send_labelrequest(), and lde_nbr_do_mappings() to follow the
algorithms defined in Appendix A of RFC 5036. Added comments and
markers for better understanding and to find missing bits.
OK michele@

Revision 1.21 / (download) - annotate - [select for diffs], Thu Oct 21 08:24:06 2010 UTC (13 years, 7 months ago) by claudio
Branch: MAIN
Changes since 1.20: +29 -19 lines
Diff to previous 1.20 (colored)

Start implementing the missing lablemapping messages in the LDE and
fix the existing ones to correctly track outstanding request and
sent / recv mappings.
Looks good to michele@

Revision 1.20 / (download) - annotate - [select for diffs], Wed Jun 30 22:15:02 2010 UTC (13 years, 11 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.19: +50 -14 lines
Diff to previous 1.19 (colored)

Make it possible to store multiple LSP to a FEC. This is another step to
handle multipath routes in MPLS.
Looks good to michele@

Revision 1.19 / (download) - annotate - [select for diffs], Wed Jun 30 05:21:38 2010 UTC (13 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.18: +1 -17 lines
Diff to previous 1.18 (colored)

Kill IMSG_KLABEL_INSERT and all the related functions around it.
IMSG_KLABEL_CHANGE is smart enough to know when something is a change
or an insert.

Revision 1.18 / (download) - annotate - [select for diffs], Wed Jun 30 01:47:11 2010 UTC (13 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.17: +2 -2 lines
Diff to previous 1.17 (colored)

Switch prefix in struct map to a struct in_addr instead of a u_int32_t.
Needed for further clean etc.

Revision 1.17 / (download) - annotate - [select for diffs], Wed Jun 9 13:32:15 2010 UTC (13 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.16: +3 -2 lines
Diff to previous 1.16 (colored)

More useful warning message.

Revision 1.16 / (download) - annotate - [select for diffs], Mon Jun 7 13:24:23 2010 UTC (13 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.15: +3 -4 lines
Diff to previous 1.15 (colored)

Store all labels in ldpd in host byte order without any additional shifting.
Add the necessary ntohl() and shifts in various places and cleanup the byte
order mess we had before. michele@ agrees.

Revision 1.15 / (download) - annotate - [select for diffs], Wed Jun 2 11:56:29 2010 UTC (14 years ago) by claudio
Branch: MAIN
Changes since 1.14: +126 -109 lines
Diff to previous 1.14 (colored)

Start reworking the LDE. Implement a FEC RB tree that can be used for the
route table and the per neighbor request and mapping lists.
The received and sent mappings are added to the per neighbor RB tree and
additionally linked to the route table. This makes lookups, etc. a lot
easier. While there flip the neighbor hash list over to a RB tree.
OK michele@

Revision 1.14 / (download) - annotate - [select for diffs], Tue May 25 13:29:45 2010 UTC (14 years ago) by claudio
Branch: MAIN
Changes since 1.13: +1 -3 lines
Diff to previous 1.13 (colored)

Remove another leftover from ospfd. ldpd does not have a concept of ext_tag
and so there is no need to carry ext_tag and rtlabels around.
"Yes! kill kill kill" michele@

Revision 1.13 / (download) - annotate - [select for diffs], Tue May 25 09:35:45 2010 UTC (14 years ago) by claudio
Branch: MAIN
Changes since 1.12: +18 -17 lines
Diff to previous 1.12 (colored)

Add upcomming IMSG_LABEL_RELEASE, IMSG_LABEL_WITHDRAW and IMSG_LABEL_ABORT.
Add missing bits to struct map and restructure/simplify the lde.c imsg
code.

Revision 1.12 / (download) - annotate - [select for diffs], Wed May 19 15:28:51 2010 UTC (14 years ago) by claudio
Branch: MAIN
Changes since 1.11: +1 -14 lines
Diff to previous 1.11 (colored)

Remove yet another ospf leftover that is not needed here. This time
neighbor self and all the madness surrounding this amazing concept.
LDP is not self aware so there is no need for this.
OK michele@

Revision 1.11 / (download) - annotate - [select for diffs], Tue May 11 15:01:46 2010 UTC (14 years ago) by claudio
Branch: MAIN
Changes since 1.10: +1 -3 lines
Diff to previous 1.10 (colored)

Kill IMSG_RECONF_AREA. LDP does not have a concept of areas.

Revision 1.10 / (download) - annotate - [select for diffs], Wed Mar 3 10:17:05 2010 UTC (14 years, 3 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.9: +4 -7 lines
Diff to previous 1.9 (colored)

Rework the kroute code by stealing some code from ospfd and massaging it
a lot more. Main reason for this is to add priority support. Additionally
add some additional NO_LABEL fixes.
OK michele@

Revision 1.9 / (download) - annotate - [select for diffs], Mon Mar 1 09:05:07 2010 UTC (14 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.8: +2 -2 lines
Diff to previous 1.8 (colored)

nitpicking, NULL instead of 0 in lde_imsg_compose_ldpe() call.

Revision 1.8 / (download) - annotate - [select for diffs], Fri Feb 19 12:49:21 2010 UTC (14 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.7: +19 -17 lines
Diff to previous 1.7 (colored)

If a neighbor goes down we need to cleanup the LIB from all FEC that point
via that neighbor. Fixes a use after free and an additional NULL dereference
in a log_debug is fixed as well.
OK michele

Revision 1.7 / (download) - annotate - [select for diffs], Mon Nov 2 20:34:58 2009 UTC (14 years, 7 months ago) by claudio
Branch: MAIN
Changes since 1.6: +7 -2 lines
Diff to previous 1.6 (colored)

More IMSG_CTL_LOG_VERBOSE, still doing the same toggeling of log_debug().

Revision 1.6 / (download) - annotate - [select for diffs], Mon Sep 28 09:48:46 2009 UTC (14 years, 8 months ago) by michele
Branch: MAIN
Changes since 1.5: +3 -18 lines
Diff to previous 1.5 (colored)

When a route is deleted, ldpd should remove labels associated with it from
lfib (the kernel lib) but not from the lib. These could be used later on when
the route come back.

ok claudio@

Revision 1.5 / (download) - annotate - [select for diffs], Sat Aug 1 13:30:55 2009 UTC (14 years, 10 months ago) by michele
Branch: MAIN
Changes since 1.4: +4 -4 lines
Diff to previous 1.4 (colored)

Pass the right size of the structure "map" to the ldpd engine.

Revision 1.4 / (download) - annotate - [select for diffs], Wed Jul 8 18:59:29 2009 UTC (14 years, 10 months ago) by michele
Branch: MAIN
Changes since 1.3: +2 -2 lines
Diff to previous 1.3 (colored)

Detect nexthop change.
React installing the label associated with the new nexthop
in the kernel routing table.

ok claudio@

Revision 1.3 / (download) - annotate - [select for diffs], Sat Jun 6 08:09:43 2009 UTC (14 years, 11 months ago) by pyr
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.2: +57 -42 lines
Diff to previous 1.2 (colored)

make ldpd imsg-in-a-lib ready too.

Revision 1.2 / (download) - annotate - [select for diffs], Fri Jun 5 22:34:45 2009 UTC (14 years, 11 months ago) by michele
Branch: MAIN
Changes since 1.1: +14 -4 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.