OpenBSD CVS

CVS log for src/usr.sbin/ospfd/control.c


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.48 / (download) - annotate - [select for diffs], Wed Mar 8 04:43:14 2023 UTC (14 months, 3 weeks ago) by guenther
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, HEAD
Changes since 1.47: +1 -3 lines
Diff to previous 1.47 (colored)

Delete obsolete /* ARGSUSED */ lint comments.

ok miod@ millert@

Revision 1.47 / (download) - annotate - [select for diffs], Tue Jan 19 09:33:38 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.46: +11 -2 lines
Diff to previous 1.46 (colored)

Internalize a few more things into the control code. Both control_state
and ctl_conns are not really needed outside of control.c

Revision 1.46 / (download) - annotate - [select for diffs], Wed Sep 16 20:50:10 2020 UTC (3 years, 8 months ago) by remi
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.45: +2 -5 lines
Diff to previous 1.45 (colored)

Stop removing the control socket on exit and tighten the unveil even
further. This is in line with what other networking daemons do.

ok mestre@

Revision 1.45 / (download) - annotate - [select for diffs], Wed Aug 29 08:43:16 2018 UTC (5 years, 9 months ago) by remi
Branch: MAIN
CVS Tags: 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
Changes since 1.44: +28 -4 lines
Diff to previous 1.44 (colored)

Prevent ospfd from starting if another ospfd is already using the same
socket. The check on the control socket happens early so that the rc
scripts detect a failure.

OK claudio@ florian@

Revision 1.44 / (download) - annotate - [select for diffs], Tue Jan 24 04:24:25 2017 UTC (7 years, 4 months ago) by benno
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.43: +2 -2 lines
Diff to previous 1.43 (colored)

sync log.c from relayd et al to ospfd.

there is still a little difference regarding handling of the verbosity
value that will be handled later.

ok claudio@

Revision 1.43 / (download) - annotate - [select for diffs], Sun Jan 8 23:04:42 2017 UTC (7 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.42: +9 -7 lines
Diff to previous 1.42 (colored)

Replace hand-rolled for(;;) traversal of ctl_conns TAILQ with
TAILQ_FOREACH().

No intentional functional change.

ok reyk@

Revision 1.42 / (download) - annotate - [select for diffs], Thu Dec 3 11:41:06 2015 UTC (8 years, 6 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.41: +3 -2 lines
Diff to previous 1.41 (colored)

imsg_read will return EAGAIN in some cases so prep code for it.
This is in the way for ospfd pledge so in it goes. OK benno@

Revision 1.41 / (download) - annotate - [select for diffs], Tue Feb 10 05:24:48 2015 UTC (9 years, 3 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.40: +5 -24 lines
Diff to previous 1.40 (colored)

Convert ospfd over to SOCK_CLOEXEC | SOCK_NONBLOCK and make the route
socket non-blocking. Introduce the same trigger for partial rt msgs.

Revision 1.40 / (download) - annotate - [select for diffs], Fri Jul 11 16:43:33 2014 UTC (9 years, 10 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.39: +2 -2 lines
Diff to previous 1.39 (colored)

Close the control fd when it has reported EOF.

ok henning@

Revision 1.39 / (download) - annotate - [select for diffs], Wed Nov 13 20:43:00 2013 UTC (10 years, 6 months ago) by benno
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.38: +2 -2 lines
Diff to previous 1.38 (colored)

from claudio
"Let msgbuf_write return -1 with errno EAGAIN. The users then must
check if this was the case and readd the event or poll again.  The
current handling in the imsg code is wrong for sure."

ok gilles, benno

Revision 1.38 / (download) - annotate - [select for diffs], Mon Mar 11 17:40:11 2013 UTC (11 years, 2 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.37: +3 -2 lines
Diff to previous 1.37 (colored)

handle ECONNABORTED errors from accept().  In many code blocks they can be
ignored silently and without aborting, much like EINTR and EWOULDBLOCK are.
ok's from various maintainers of these directories...

Revision 1.37 / (download) - annotate - [select for diffs], Wed Apr 11 08:33:53 2012 UTC (12 years, 1 month ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2
Changes since 1.36: +2 -3 lines
Diff to previous 1.36 (colored)

delete excessive evtimer_pending; ok claudio

Revision 1.36 / (download) - annotate - [select for diffs], Tue Apr 10 07:56:54 2012 UTC (12 years, 1 month ago) by deraadt
Branch: MAIN
Changes since 1.35: +30 -5 lines
Diff to previous 1.35 (colored)

Handle file descriptor exhaustion in the accept() case.
ok claudio

Revision 1.35 / (download) - annotate - [select for diffs], Mon May 9 12:24:41 2011 UTC (13 years ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.34: +2 -1 lines
Diff to previous 1.34 (colored)

First bits to support opaque LSA. Type-9, 10 and 11 are LSA that can
hold about any data you like and is used for things like greaceful
reload. Implement the basic redistribute logic and LSDB handling but
the data sent is currently not looked at.
Tested and OK sthen@

Revision 1.34 / (download) - annotate - [select for diffs], Thu Sep 2 14:03:22 2010 UTC (13 years, 9 months ago) by sobrado
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.33: +2 -2 lines
Diff to previous 1.33 (colored)

remove trailing spaces and tabs from source code; no binary changes
(verified by both sthen@ and me).

ok sthen@; "just commit it" claudio@

Revision 1.33 / (download) - annotate - [select for diffs], Fri May 14 11:52:19 2010 UTC (14 years ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.32: +2 -2 lines
Diff to previous 1.32 (colored)

Use calloc() instead of malloc() to allocate the connection structure. This
way the memory is zeroed. This is equivalent to the relayd commit by reyk.
OK reyk, jsg

Revision 1.32 / (download) - annotate - [select for diffs], Sun Feb 21 20:53:20 2010 UTC (14 years, 3 months ago) by michele
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.31: +1 -3 lines
Diff to previous 1.31 (colored)

Kill double declaration of control_imsg_relay().

From Christiano F. Haesbaert.

ok claudio@

Revision 1.31 / (download) - annotate - [select for diffs], Fri Feb 19 10:35:52 2010 UTC (14 years, 3 months ago) by dlg
Branch: MAIN
Changes since 1.30: +1 -0 lines
Diff to previous 1.30 (colored)

implement ospfctl fib reload.

this tells the daemon to resync the kernels list of interfaces and routes
with the daemons list. this is very useful if the routing socket overflows
and you want to sync things up again.

lots and lots of help from claudio@
ok claudio@

Revision 1.30 / (download) - annotate - [select for diffs], Tue Dec 8 15:54:50 2009 UTC (14 years, 5 months ago) by jsg
Branch: MAIN
Changes since 1.29: +2 -2 lines
Diff to previous 1.29 (colored)

porcesses -> processes

Revision 1.29 / (download) - annotate - [select for diffs], Wed Dec 2 19:10:02 2009 UTC (14 years, 6 months ago) by mk
Branch: MAIN
Changes since 1.28: +2 -2 lines
Diff to previous 1.28 (colored)

log_warn() consistency.

`OK' claudio

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

Implement IMSG_CTL_LOG_VERBOSE to enable or disable debug logging on runtime.
It always annoyed me that in case of a problem I had to restart the ospf in
forground debug mode and by doing so losing all routes at least twice.
OK henning, sthen, michele

Revision 1.27 / (download) - annotate - [select for diffs], Sat Jun 6 07:31:26 2009 UTC (14 years, 11 months ago) by eric
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.26: +21 -20 lines
Diff to previous 1.26 (colored)

sync ospfctl/ospfd with the common imsg code, making it lib ready as well.

"looks ok" claudio@

Revision 1.26 / (download) - annotate - [select for diffs], Fri Jun 5 19:33:58 2009 UTC (15 years ago) by pyr
Branch: MAIN
Changes since 1.25: +5 -5 lines
Diff to previous 1.25 (colored)

make ospfd's imsg lib ready as well.
ok claudio@

Revision 1.25 / (download) - annotate - [select for diffs], Sun May 31 18:46:01 2009 UTC (15 years ago) by jacekm
Branch: MAIN
Changes since 1.24: +1 -2 lines
Diff to previous 1.24 (colored)

Remove redundant imsg_event_add calls; ok claudio@

Revision 1.24 / (download) - annotate - [select for diffs], Sun May 31 16:58:54 2009 UTC (15 years ago) by claudio
Branch: MAIN
Changes since 1.23: +5 -9 lines
Diff to previous 1.23 (colored)

The libevent callback function may be called with EV_READ and EV_WRITE
set at the same time so using a switch to do read or write is a bad idea.
Problem noticed by Eygene Ryabinkin on FreeBSD for some reasons it is not
triggered on OpenBSD.
Fix aggreed by a most other libevent hackers

Revision 1.23 / (download) - annotate - [select for diffs], Tue Apr 7 14:57:33 2009 UTC (15 years, 1 month ago) by reyk
Branch: MAIN
Changes since 1.22: +11 -11 lines
Diff to previous 1.22 (colored)

allow to specify an alternate control socket instead of /var/run/ospfd.sock.
this is required to run multiple instances of ospfd.

ok claudio@

Revision 1.22 / (download) - annotate - [select for diffs], Wed Feb 25 17:09:55 2009 UTC (15 years, 3 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.21: +4 -2 lines
Diff to previous 1.21 (colored)

Fix an invalid pointer dereference in control_close(). If control_connbyfd()
fails -- which should never happen -- the function does not return and is
accession the NULL set control pointer later on.
Found by Matthew Haub. OK deraadt@

Revision 1.21 / (download) - annotate - [select for diffs], Fri Nov 21 11:14:42 2008 UTC (15 years, 6 months ago) by claudio
Branch: MAIN
Changes since 1.20: +2 -2 lines
Diff to previous 1.20 (colored)

imsg_* returns ssize_t

Revision 1.20 / (download) - annotate - [select for diffs], Thu Jan 31 12:17:35 2008 UTC (16 years, 4 months ago) by henning
Branch: MAIN
CVS Tags: OPENBSD_4_4_BASE, OPENBSD_4_4, OPENBSD_4_3_BASE, OPENBSD_4_3
Changes since 1.19: +2 -1 lines
Diff to previous 1.19 (colored)

do not leak confd on malloc failure in control_accept()
found by Igor Zinovik <zinovik@cs.karelia.ru>

Revision 1.19 / (download) - annotate - [select for diffs], Sat Oct 13 13:21:24 2007 UTC (16 years, 7 months ago) by claudio
Branch: MAIN
Changes since 1.18: +2 -2 lines
Diff to previous 1.18 (colored)

Funny typo, it is fib not fip so adjust function name.

Revision 1.18 / (download) - annotate - [select for diffs], Wed Mar 21 10:54:30 2007 UTC (17 years, 2 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_4_2_BASE, OPENBSD_4_2
Changes since 1.17: +3 -1 lines
Diff to previous 1.17 (colored)

Add support for RFC 3137: OSPF Stub Router Advertisement
This allows ospfd to announce networks without the need to transit traffic.
stub router is enabled if the fib is not coupled, net.inet.ip.forwarding is
not 1 or if the stub router global config option is set to yes.
OK norby@

Revision 1.17 / (download) - annotate - [select for diffs], Mon Mar 19 10:03:25 2007 UTC (17 years, 2 months ago) by henning
Branch: MAIN
Changes since 1.16: +2 -2 lines
Diff to previous 1.16 (colored)

when our red/recv/recvmsg in imsg_read gives EINTR or EAGAIN, do not
signal "connection closed" upstream.
spotted by Valentin Kozamernik <tin@komna.com>

Revision 1.16 / (download) - annotate - [select for diffs], Tue Jan 23 17:39:33 2007 UTC (17 years, 4 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_4_1_BASE, OPENBSD_4_1
Changes since 1.15: +3 -3 lines
Diff to previous 1.15 (colored)

Typo in fatal() message found by dunceor @ gmail dot com

Revision 1.15 / (download) - annotate - [select for diffs], Tue Apr 25 08:00:22 2006 UTC (18 years, 1 month ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_4_0_BASE, OPENBSD_4_0
Changes since 1.14: +3 -1 lines
Diff to previous 1.14 (colored)

Mark event handlers with ARGSUSED to please lint.

Revision 1.14 / (download) - annotate - [select for diffs], Tue Mar 21 17:49:00 2006 UTC (18 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.13: +2 -4 lines
Diff to previous 1.13 (colored)

Kill debug message that floods the log if ospfctl is killed while dumping
large tables.

Revision 1.13 / (download) - annotate - [select for diffs], Fri Feb 10 18:30:47 2006 UTC (18 years, 3 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_3_9_BASE, OPENBSD_3_9
Changes since 1.12: +3 -3 lines
Diff to previous 1.12 (colored)

ospfd does not need fd passing via the imsg framework so remove that code
and remove other unneeded functions that are only used in bgpd.

Revision 1.12 / (download) - annotate - [select for diffs], Tue Oct 18 15:42:15 2005 UTC (18 years, 7 months ago) by claudio
Branch: MAIN
Changes since 1.11: +4 -7 lines
Diff to previous 1.11 (colored)

Simplify code a bit. OK norby@

Revision 1.11 / (download) - annotate - [select for diffs], Thu May 12 19:10:12 2005 UTC (19 years ago) by norby
Branch: MAIN
CVS Tags: OPENBSD_3_8_BASE, OPENBSD_3_8
Changes since 1.10: +7 -1 lines
Diff to previous 1.10 (colored)

Add "show database asbr/external/network/router/self-originate/summary"
to ospfctl.

Show detailed information about the LSAs in the Link State Database.

ok claudio@

Revision 1.10 / (download) - annotate - [select for diffs], Sat Mar 26 13:35:16 2005 UTC (19 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.9: +2 -1 lines
Diff to previous 1.9 (colored)

Implement the IMSG_CTL_IFINFO bits correctly. This is needed for
"ospfctl show fib interface".
OK henning@ norby@

Revision 1.9 / (download) - annotate - [select for diffs], Tue Mar 22 22:13:48 2005 UTC (19 years, 2 months ago) by norby
Branch: MAIN
Changes since 1.8: +2 -2 lines
Diff to previous 1.8 (colored)

Remove bool cruft.

ok claudio@

Revision 1.8 / (download) - annotate - [select for diffs], Tue Mar 15 22:03:56 2005 UTC (19 years, 2 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_3_7_BASE, OPENBSD_3_7
Changes since 1.7: +8 -1 lines
Diff to previous 1.7 (colored)

Add control messages for the show fib commands.
OK norby@ deraadt@

Revision 1.7 / (download) - annotate - [select for diffs], Tue Mar 15 16:59:45 2005 UTC (19 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.6: +2 -2 lines
Diff to previous 1.6 (colored)

First close() than unlink().

Revision 1.6 / (download) - annotate - [select for diffs], Mon Mar 14 18:21:29 2005 UTC (19 years, 2 months ago) by norby
Branch: MAIN
Changes since 1.5: +2 -1 lines
Diff to previous 1.5 (colored)

Add "show summary" to ospfctl.

ok claudio@ henning@

Revision 1.5 / (download) - annotate - [select for diffs], Mon Mar 14 16:57:41 2005 UTC (19 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.4: +2 -1 lines
Diff to previous 1.4 (colored)

unlink() control socket in error path. Spotted by Theo at FOSDEM.
Was way too long in one of my trees.

Revision 1.4 / (download) - annotate - [select for diffs], Sat Mar 12 11:03:05 2005 UTC (19 years, 2 months ago) by norby
Branch: MAIN
Changes since 1.3: +5 -0 lines
Diff to previous 1.3 (colored)

Add "show rib" and "show rib detail" to ospfctl.

ok henning@

Revision 1.3 / (download) - annotate - [select for diffs], Sat Mar 12 10:49:12 2005 UTC (19 years, 2 months ago) by norby
Branch: MAIN
Changes since 1.2: +1 -2 lines
Diff to previous 1.2 (colored)

Small K&F.

ok henning@

Revision 1.2 / (download) - annotate - [select for diffs], Fri Mar 11 15:48:58 2005 UTC (19 years, 2 months ago) by deraadt
Branch: MAIN
Changes since 1.1: +4 -4 lines
Diff to previous 1.1 (colored)

move umask() song and dance closer around the bind, being more careful about errors; ok claudio

Revision 1.1 / (download) - annotate - [select for diffs], Fri Jan 28 14:05:40 2005 UTC (19 years, 4 months ago) by claudio
Branch: MAIN

Welcome ospfd
started by Esben Norby some time ago by using the imsg/three process framework
of bgpd. He implemented the basic concept plus the ospf finite state machines.
Later I joined and helped him cleanup, debug and extend his work.
Right now it is not particularly useful, major parts are still missing but is
imported to allow more people to work on it.
status:
The basic protocol works for broadcast networks and the LS database is
synchronized and updated. It is not possible to be DR or BDR on a network
and other interface types like point-to-point are not yet supported.
The shortest path tree is not calculated and so no routing information is
exchanged with the kernel FIB.

Not yet connected to the builds.
OK henning@

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.