OpenBSD CVS

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


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.82 / (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, HEAD
Changes since 1.81: +5 -5 lines
Diff to previous 1.81 (colored)

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

Revision 1.81 / (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.80: +1 -5 lines
Diff to previous 1.80 (colored)

Delete obsolete /* ARGSUSED */ lint comments.

ok miod@ millert@

Revision 1.80 / (download) - annotate - [select for diffs], Tue Jan 19 15:59: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.79: +1 -5 lines
Diff to previous 1.79 (colored)

Adjust the disc_recv_packet() code to not use IBUF_READ_SIZE and to
use a local recv_buf that is allocated on first call with malloc().
The memory returned from malloc() is properly aligned which may not
be the case for bss or stack memory.

Revision 1.79 / (download) - annotate - [select for diffs], Tue Jan 19 15:23:25 2021 UTC (3 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.78: +2 -2 lines
Diff to previous 1.78 (colored)

Kill log_procnames and properly define ldpd_process.

Revision 1.78 / (download) - annotate - [select for diffs], Tue Jan 19 15:14:35 2021 UTC (3 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.77: +1 -2 lines
Diff to previous 1.77 (colored)

Do the same control cleanup as in other daemons. Move ctl_conns exclusivly
into control.c

Revision 1.77 / (download) - annotate - [select for diffs], Mon Jun 22 15:09:34 2020 UTC (3 years, 11 months ago) by mestre
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.76: +2 -2 lines
Diff to previous 1.76 (colored)

On my previous commit I made the wrong assumption that the control socket was
being unlink(2)ed from the main proc so I removed "cpath" from the pledge(2) on
the ldpe proc but actually the socket was unlink(2)ed from here, this means the
daemon would crash on exit due to pledge(2) not having "cpath" permissions
anymore. Finish the job by just not deleting the socket at all during
control_cleanup(), which keeps the control program still working without issues
but more importantly prevents the crash during exit, sorry about that.

Crash reported by wlund at iki.fi

OK deraadt@ claudio@ remi@

Revision 1.76 / (download) - annotate - [select for diffs], Sat Aug 10 01:30:53 2019 UTC (4 years, 9 months ago) by mestre
Branch: MAIN
CVS Tags: OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.75: +2 -2 lines
Diff to previous 1.75 (colored)

Like we did on other daemons that cannot be pledged due to forbidden ioctls the
main process can be unveiled to restrict filesystem access. In this case we can
restrict it to only read, although it must be the entire / since the daemon is
able to include config files from anywhere.

Additionally the ldpe process currently has cpath promise to unlink the socket,
nevertheless the socket is actually unlinked from the main proc so this
permission can be removed. As we discussed before, leaving the socket behind
doesn't do any harm that's why I didn't unveil it in the main proc.

OK deraadt@

Revision 1.75 / (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_5_BASE, OPENBSD_6_5
Changes since 1.74: +16 -4 lines
Diff to previous 1.74 (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.74 / (download) - annotate - [select for diffs], Sat Mar 4 00:21:48 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.73: +19 -7 lines
Diff to previous 1.73 (colored)

Send VPLS MAC withdrawals.

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.

Revision 1.73 / (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.72: +2 -3 lines
Diff to previous 1.72 (colored)

Minor tweaks.

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

Allow to specify an alternate control socket.

This is required to run multiple instances of ldpd.

OK claudio@

Revision 1.71 / (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.70: +2 -1 lines
Diff to previous 1.70 (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.70 / (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.69: +2 -4 lines
Diff to previous 1.69 (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.69 / (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.68: +11 -7 lines
Diff to previous 1.68 (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.68 / (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.67: +2 -2 lines
Diff to previous 1.67 (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.67 / (download) - annotate - [select for diffs], Sat Jun 18 17:31:32 2016 UTC (7 years, 11 months ago) by renato
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0
Changes since 1.66: +2 -2 lines
Diff to previous 1.66 (colored)

Fix removal of dual-stack neighbors.

Revision 1.66 / (download) - annotate - [select for diffs], Mon Jun 13 23:01:37 2016 UTC (7 years, 11 months ago) by renato
Branch: MAIN
Changes since 1.65: +2 -1 lines
Diff to previous 1.65 (colored)

Implement support for the Configuration Sequence Number TLV.

The Configuration Sequence Number optional TLV is documented in RFC 5036,
pages 53 and 54.

Fixes IxANVL LDP test 23.10.

Revision 1.65 / (download) - annotate - [select for diffs], Mon Jun 13 20:15:58 2016 UTC (7 years, 11 months ago) by renato
Branch: MAIN
Changes since 1.64: +5 -3 lines
Diff to previous 1.64 (colored)

Do not create sockets for disabled address-families.

Revision 1.64 / (download) - annotate - [select for diffs], Thu Jun 9 17:26:32 2016 UTC (7 years, 11 months ago) by renato
Branch: MAIN
Changes since 1.63: +2 -2 lines
Diff to previous 1.63 (colored)

Send a fatal notification when the last hello adjacency is deleted.

RFC 5036 says:
  "When the last Hello adjacency for an LDP session is
  deleted, the LSR terminates the LDP session by sending a Notification
  message and closing the transport connection".

Send a "Hold Timer Expired" notification when the triggering event is
a hello hold time timeout. In the other cases, like disabling LDP on an
interface, send a "Shutdown" notification instead.

Before this patch we were just closing the neighbor's transport
connection.

Fixes the following ANVL LDP tests: 7.17 and 23.3.

Revision 1.63 / (download) - annotate - [select for diffs], Wed Jun 8 23:30:07 2016 UTC (7 years, 11 months ago) by renato
Branch: MAIN
Changes since 1.62: +20 -1 lines
Diff to previous 1.62 (colored)

Fix quick reconnect when the transport address is changed.

When the transport address is changed, we can't try to reconnect to the
neighbors inside merge_af() because the ldpe process still didn't receive
the new network sockets from the parent at this point. To resolve this,
try to reconnect just after we receive these sockets.

Revision 1.62 / (download) - annotate - [select for diffs], Mon Jun 6 16:42:41 2016 UTC (7 years, 11 months ago) by renato
Branch: MAIN
Changes since 1.61: +2 -2 lines
Diff to previous 1.61 (colored)

Fix imsg parameter passing

When ldpe requests new network sockets to the parent process (after the
transport-address is changed), it must specify the desired address-family
(IPv4 or IPv6). We can use the 'pid' or 'peerid' members of the imsg_hdr
structure for this. Use 'pid' for convenience (no need to extend the
wrapper function, ldpe_imsg_compose_parent()).

Revision 1.61 / (download) - annotate - [select for diffs], Mon May 23 19:16:00 2016 UTC (8 years ago) by renato
Branch: MAIN
Changes since 1.60: +29 -36 lines
Diff to previous 1.60 (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.60 / (download) - annotate - [select for diffs], Mon May 23 19:14:03 2016 UTC (8 years ago) by renato
Branch: MAIN
Changes since 1.59: +2 -1 lines
Diff to previous 1.59 (colored)

Update copyright information.

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

Remove superfluous includes.

Revision 1.58 / (download) - annotate - [select for diffs], Mon May 23 19:09:25 2016 UTC (8 years ago) by renato
Branch: MAIN
Changes since 1.57: +26 -17 lines
Diff to previous 1.57 (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.57 / (download) - annotate - [select for diffs], Mon May 23 18:58:48 2016 UTC (8 years ago) by renato
Branch: MAIN
Changes since 1.56: +116 -62 lines
Diff to previous 1.56 (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.56 / (download) - annotate - [select for diffs], Mon May 23 18:55:21 2016 UTC (8 years ago) by renato
Branch: MAIN
Changes since 1.55: +2 -2 lines
Diff to previous 1.55 (colored)

Assorted fixes and small cleanup.

Nothing really interesting here.

Revision 1.55 / (download) - annotate - [select for diffs], Mon May 23 18:41:59 2016 UTC (8 years ago) by renato
Branch: MAIN
Changes since 1.54: +10 -1 lines
Diff to previous 1.54 (colored)

Enable changing the router-id via config reload.

Now ldpd can start without a router-id, since it can be set later. Since
a router-id of 0.0.0.0 is invalid, interfaces and targeted-neighbors
will check for a valid router-id in order to be activated.

When the router-id is changed, all the neighborships are reset.

Revision 1.54 / (download) - annotate - [select for diffs], Mon May 23 18:40:15 2016 UTC (8 years ago) by renato
Branch: MAIN
Changes since 1.53: +25 -1 lines
Diff to previous 1.53 (colored)

Several fixes in the config reload handling.

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

Don't create l2vpn targeted neighbors inside the config parser.

When removing a configured pseudowire, we remove the associated tnbr
in ldpe_l2vpn_pw_exit(). So, when a new pseudowire is configured, it
makes sense to create its tnbr in ldpe_l2vpn_pw_init() to keep things
consistent.

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

Add an exception for kernels built without PFKEYv2 support.

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

Create network sockets on the parent process.

We drop our privileges in ldpe right after we create the network sockets.
The problem is that we might want to change the transport-address and
reload the config, in which case we need new sockets. To allow that,
always create the network sockets in the parent process and pass them
to ldpe via imsg.

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

Move socket creation and setup into a specialized function.

Right now we use three network sockets in ldpd:
* the discovery socket (udp+mcast);
* the extended discovery socket (udp);
* the session socket (tcp).

When we introduce IPv6 support, we'll get three more sockets. In order
to prevent code duplication in the future, add a specialized function
that creates a socket according to the given type (and address-family
later). This also improves readability because it makes it easier to
see the differences between each socket.

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: +62 -110 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 15:51:36 2016 UTC (8 years ago) by renato
Branch: MAIN
Changes since 1.47: +4 -4 lines
Diff to previous 1.47 (colored)

pledge() earlier on ldpe.

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

Move some code around.

This patch doesn't introduce any logical change.

Revision 1.46 / (download) - annotate - [select for diffs], Mon May 23 15:43:11 2016 UTC (8 years ago) by renato
Branch: MAIN
Changes since 1.45: +2 -2 lines
Diff to previous 1.45 (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.45 / (download) - annotate - [select for diffs], Mon May 23 15:20:21 2016 UTC (8 years ago) by renato
Branch: MAIN
Changes since 1.44: +2 -3 lines
Diff to previous 1.44 (colored)

Clear the configuration before closing the network sockets.

This fixes some errors and warnings when ldpd is shutting down.

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

Replace manually written function names with __func__.

Revision 1.43 / (download) - annotate - [select for diffs], Mon May 23 14:59:50 2016 UTC (8 years ago) by renato
Branch: MAIN
Changes since 1.42: +7 -6 lines
Diff to previous 1.42 (colored)

Explicitly close the pfkey socket on exit.

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

Call accept_del() on exit.

Revision 1.41 / (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.40: +5 -5 lines
Diff to previous 1.40 (colored)

EAGAIN handling for imsg_read. OK henning@ benno@

Revision 1.40 / (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.39: +4 -1 lines
Diff to previous 1.39 (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.39 / (download) - annotate - [select for diffs], Tue Jul 21 05:04:12 2015 UTC (8 years, 10 months ago) by renato
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.38: +3 -1 lines
Diff to previous 1.38 (colored)

Call control_cleanup() from the ldpe process, where it belongs.

ok claudio@

Revision 1.38 / (download) - annotate - [select for diffs], Tue Jul 21 05:02:57 2015 UTC (8 years, 10 months ago) by renato
Branch: MAIN
Changes since 1.37: +29 -5 lines
Diff to previous 1.37 (colored)

Rename, move and reuse mapping list functions.

ok claudio@

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

Fix some awful ipc synchronization issues.

Under some rare circumstances the following can happen:
1 - one neighbor sends a label withdraw followed by a fatal notification
    message;
2 - ldpe parses the label withdraw and sends it to lde;
3 - ldpe parses the fatal notification message and closes the session;
4 - lde processes the label withdraw and asks ldpe to send a label release;
5 - at around the same time, ldpe restarts the session with the neighbor;
6 - ldpe processes the lde message and then sends a label release to the new
    neighbor.

The problem is that we don't want a message enqueue to a neighbor to be sent
after the session is restarted. If a session is closed, all the enqueued
messages should be discarded.

To acomplish this, we update the peerid of the nbr structure everytime the
session is established.

ok claudio@

Revision 1.36 / (download) - annotate - [select for diffs], Tue Jul 21 04:52:29 2015 UTC (8 years, 10 months ago) by renato
Branch: MAIN
Changes since 1.35: +34 -3 lines
Diff to previous 1.35 (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.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: +16 -24 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: +49 -13 lines
Diff to previous 1.33 (colored)

Add configuration reload support.

ok claudio@

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

Improve handling of addresses on ldpe.

This is a preliminary work for the the next patch (sigup config
reload). We want to make sure that the ldpe process can handle duplicated
addresses.

The idea is to alloc two different if_addr structures for each address,
and link one in the global list of addresses (used to send address
messages) and link the other to the associated interface list of
addresses.

Doing that we will be able to call kif_redistribute() after reloading
the config file and activate the new LDP enabled interfaces.

NOTE: Interfaces are created at config parse time and the child
processes inherit them on fork() so there's no need to send a status
update at startup.

ok claudio@

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

Implement md5 authentication support.

ok claudio@

Revision 1.31 / (download) - annotate - [select for diffs], Sun Jul 19 20:54:17 2015 UTC (8 years, 10 months ago) by renato
Branch: MAIN
Changes since 1.30: +10 -1 lines
Diff to previous 1.30 (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.30 / (download) - annotate - [select for diffs], Sat Mar 21 18:32:01 2015 UTC (9 years, 2 months ago) by renato
Branch: MAIN
Changes since 1.29: +4 -19 lines
Diff to previous 1.29 (colored)

Remove interface finite state machine.

In the name of simplicity, remove the interface FSM that was inherited
from ospfd. In ldpd interfaces are just up or down, so keeping a
FSM for that is an overkill. Now instead of calling if_fsm(), just
call if_update() whenever a relevant event occurs (status change,
address addition/removal).

Additional notes:
1 - s/if_act_/if_/

2 - Remove the IMSG_IFUP and IMSG_IFDOWN events. Now whenever an
interface changes its state a IMSG_IFSTATUS event will be generated
with the new status.

kroute.c ldpd.h ldpe.c ldpe.h CVS:
----------------------------------------------------------------------

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

Don't try to send address withdraws to neighbors that are unreachable
after an address removal in the system.

Revision 1.28 / (download) - annotate - [select for diffs], Sat Mar 21 17:33:10 2015 UTC (9 years, 2 months ago) by renato
Branch: MAIN
Changes since 1.27: +2 -1 lines
Diff to previous 1.27 (colored)

Close extended discovery socket on exit.

Revision 1.27 / (download) - annotate - [select for diffs], Tue Feb 10 01:03:54 2015 UTC (9 years, 3 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.26: +5 -3 lines
Diff to previous 1.26 (colored)

Pass SOCK_NONBLOCK | SOCK_CLOEXEC to some more sockets. We never want to
sleep on a socket.

Revision 1.26 / (download) - annotate - [select for diffs], Mon Feb 9 11:54:24 2015 UTC (9 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.25: +3 -3 lines
Diff to previous 1.25 (colored)

More SOCK_NONBLOCK | SOCK_CLOEXEC love and one less session_socket_blockmode

Revision 1.25 / (download) - annotate - [select for diffs], Tue Nov 18 20:54:28 2014 UTC (9 years, 6 months ago) by krw
Branch: MAIN
Changes since 1.24: +1 -2 lines
Diff to previous 1.24 (colored)

Nuke more obvious #include duplications.

ok deraadt@ millert@ tedu@

Revision 1.24 / (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_6_BASE, OPENBSD_5_6
Changes since 1.23: +7 -3 lines
Diff to previous 1.23 (colored)

Close connections when msgbuf_write() returns 0.

ok claudio@

Revision 1.23 / (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.22: +2 -2 lines
Diff to previous 1.22 (colored)

deal with msgbuf_write EAGAIN, ok gilles benno

Revision 1.22 / (download) - annotate - [select for diffs], Thu Oct 17 17:52:21 2013 UTC (10 years, 7 months ago) by renato
Branch: MAIN
Changes since 1.21: +7 -4 lines
Diff to previous 1.21 (colored)

Respect the max pdu length and merge all send_label* functions into
a single generic function.

Revision 1.21 / (download) - annotate - [select for diffs], Tue Jun 4 02:25:28 2013 UTC (11 years ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.20: +47 -3 lines
Diff to previous 1.20 (colored)

Implement support for adjacencies and targeted hellos
Refactor adjacencies out of the neighbor handling so that it is possible to
have more complex topologies with targeted sessions.
From Renato Westphal

Revision 1.20 / (download) - annotate - [select for diffs], Tue Jun 4 00:45:00 2013 UTC (11 years ago) by claudio
Branch: MAIN
Changes since 1.19: +6 -6 lines
Diff to previous 1.19 (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.19 / (download) - annotate - [select for diffs], Tue Jun 4 00:41:18 2013 UTC (11 years ago) by claudio
Branch: MAIN
Changes since 1.18: +4 -4 lines
Diff to previous 1.18 (colored)

fix some minor issues before proceeding with the remaining patches from
Renato Westphal. Diff by Renato Westphal

Revision 1.18 / (download) - annotate - [select for diffs], Mon Jun 3 16:53:49 2013 UTC (11 years ago) by claudio
Branch: MAIN
Changes since 1.17: +88 -37 lines
Diff to previous 1.17 (colored)

Implement support for multiple addresses per interface.
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

Revision 1.17 / (download) - annotate - [select for diffs], Sat Jun 1 19:01:32 2013 UTC (11 years ago) by claudio
Branch: MAIN
Changes since 1.16: +7 -1 lines
Diff to previous 1.16 (colored)

Improve error handling on session_read
* 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

Revision 1.16 / (download) - annotate - [select for diffs], Thu Apr 12 17:33:43 2012 UTC (12 years, 1 month ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2
Changes since 1.15: +3 -5 lines
Diff to previous 1.15 (colored)

accept pacing ldpd way. Since this daemon has multiple listening fds
we add them all to a accept queue that does the pacing with the
accept_pause() and accept_unpause() calls.
With and OK deraadt@

Revision 1.15 / (download) - annotate - [select for diffs], Mon Jul 4 04:34:14 2011 UTC (12 years, 11 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.14: +3 -8 lines
Diff to previous 1.14 (colored)

LINK_STATE_IS_UP() cleanup userland part. There is no need to special
case carp(4) interfaces anymore. LINK_STATE_IS_UP() almost always does
the right job.
OK deraadt@ henning@

This needs a -current kernel or link state may be not reported correctly.

Revision 1.14 / (download) - annotate - [select for diffs], Mon Jan 10 12:28:25 2011 UTC (13 years, 4 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.13: +1 -21 lines
Diff to previous 1.13 (colored)

Fix a bad heritage from ospfd. Make neighbors independent of interfaces.
They are not bound as strongly as in ospf and causes problems when the
TCP connection is established from an not connected IP (e.g. a loopback).
Use three RB trees to sort the neighbor list by id, addr and peerid.
More cleanup is needed but this makes ldpd work against peers using
loopback IPs. Problem found, reported and fix tested again by Marcel Wiget.

Revision 1.13 / (download) - annotate - [select for diffs], Tue Oct 26 12:03:11 2010 UTC (13 years, 7 months ago) by claudio
Branch: MAIN
Changes since 1.12: +27 -49 lines
Diff to previous 1.12 (colored)

Shuffle the deck chairs to make the code more compact.
OK michele@

Revision 1.12 / (download) - annotate - [select for diffs], Wed Sep 1 13:54:54 2010 UTC (13 years, 9 months ago) by claudio
Branch: MAIN
Changes since 1.11: +1 -13 lines
Diff to previous 1.11 (colored)

s/lfib/fib/ for more consitency with the other routing daemons.
This started manly because of ldpctl beeing inconsistent and me misstyping
lfib almost every time.
OK michele@

Revision 1.11 / (download) - annotate - [select for diffs], Thu Jul 8 09:41:05 2010 UTC (13 years, 10 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.10: +11 -4 lines
Diff to previous 1.10 (colored)

Kill more code in kroute.c that is unneeded in ldpd. ldpd is a bit strange
since it does not care that much about reachability of routes. The idea is
to have diverse LSP in the kernel and the kernel should then decide which
path should be used.
OK michele@

Revision 1.10 / (download) - annotate - [select for diffs], Wed May 26 13:56:07 2010 UTC (14 years ago) by nicm
Branch: MAIN
Changes since 1.9: +2 -2 lines
Diff to previous 1.9 (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.9 / (download) - annotate - [select for diffs], Wed May 19 15:28:51 2010 UTC (14 years ago) by claudio
Branch: MAIN
Changes since 1.8: +5 -7 lines
Diff to previous 1.8 (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.8 / (download) - annotate - [select for diffs], Tue May 11 15:01:46 2010 UTC (14 years ago) by claudio
Branch: MAIN
Changes since 1.7: +1 -3 lines
Diff to previous 1.7 (colored)

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

Revision 1.7 / (download) - annotate - [select for diffs], Thu Apr 29 12:09:28 2010 UTC (14 years, 1 month ago) by claudio
Branch: MAIN
Changes since 1.6: +2 -3 lines
Diff to previous 1.6 (colored)

Remove some more ospfd-ism from the interface code. This time remove
of most of the IF_TYPE_ special cases and most interface types.
Point-to-point and broadcast still present because of find_iface()
which needs addtional fixing.
OK michele@

Revision 1.6 / (download) - annotate - [select for diffs], Thu Apr 15 15:04:23 2010 UTC (14 years, 1 month ago) by claudio
Branch: MAIN
Changes since 1.5: +4 -5 lines
Diff to previous 1.5 (colored)

Instead of having three ways of setting fds non-blocking use
session_socket_blockmode() everywhere.
Additionally make two fatal() distinguishable.
OK michele@

Revision 1.5 / (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.4: +2 -2 lines
Diff to previous 1.4 (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.4 / (download) - annotate - [select for diffs], Thu Feb 18 10:50:14 2010 UTC (14 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.3: +4 -3 lines
Diff to previous 1.3 (colored)

We need to set SO_REUSEADDR before doing the bind() of the tcp socket.
It does not help to set SO_REUSEPORT after doing the bind.
Fixes failures to start ldpd because of TIME_WAIT sessions.
OK michele

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: +41 -35 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: +6 -5 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.