OpenBSD CVS

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


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.117 / (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.116: +1 -4 lines
Diff to previous 1.116 (colored)

Delete obsolete /* ARGSUSED */ lint comments.

ok miod@ millert@

Revision 1.116 / (download) - annotate - [select for diffs], Mon Sep 6 13:32:18 2021 UTC (2 years, 8 months ago) by deraadt
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
Changes since 1.115: +2 -2 lines
Diff to previous 1.115 (colored)

repair missing paths on unveil failure

Revision 1.115 / (download) - annotate - [select for diffs], Tue Jan 19 09:37:53 2021 UTC (3 years, 4 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.114: +4 -3 lines
Diff to previous 1.114 (colored)

Make the imsg event structures static, properly define ospfd_process and
rename nconf in the ospf engine to noeconf. This fixes the last common
symbols in ospfd.

Revision 1.114 / (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.113: +2 -4 lines
Diff to previous 1.113 (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.113 / (download) - annotate - [select for diffs], Fri Jun 26 19:04:38 2020 UTC (3 years, 11 months ago) by bket
Branch: MAIN
Changes since 1.112: +3 -9 lines
Diff to previous 1.112 (colored)

Replace SIMPLEQ concatenation loop with SIMPLEQ_CONCAT

OK florian@, millert@, kn@

Revision 1.112 / (download) - annotate - [select for diffs], Sun Mar 29 12:36:01 2020 UTC (4 years, 2 months ago) by denis
Branch: MAIN
CVS Tags: OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.111: +3 -3 lines
Diff to previous 1.111 (colored)

Change space to tab

Revision 1.111 / (download) - annotate - [select for diffs], Tue Jan 21 20:38:52 2020 UTC (4 years, 4 months ago) by remi
Branch: MAIN
Changes since 1.110: +3 -4 lines
Diff to previous 1.110 (colored)

Allow the interface setting "type p2p" to be configured globallz or per
area. Most of the other interface settings allow this.

ok denis@

Revision 1.110 / (download) - annotate - [select for diffs], Sat Nov 23 15:05:21 2019 UTC (4 years, 6 months ago) by remi
Branch: MAIN
Changes since 1.109: +5 -5 lines
Diff to previous 1.109 (colored)

These dependon related lines fit better a bit further up.
No functional change.

Suggested and OK claudio@

Revision 1.109 / (download) - annotate - [select for diffs], Tue Nov 19 09:55:55 2019 UTC (4 years, 6 months ago) by remi
Branch: MAIN
Changes since 1.108: +10 -1 lines
Diff to previous 1.108 (colored)

Add point-to-point support for broadcast interfaces.

tested by Kapetanakis Giannis
ok claudio@

Revision 1.108 / (download) - annotate - [select for diffs], Thu May 16 05:49:22 2019 UTC (5 years ago) by denis
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.107: +7 -1 lines
Diff to previous 1.107 (colored)

Do not change router-id on reload if unspecified.

OK remi@

Revision 1.107 / (download) - annotate - [select for diffs], Tue Mar 26 20:39:33 2019 UTC (5 years, 2 months ago) by remi
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.106: +2 -3 lines
Diff to previous 1.106 (colored)

The recently introduced "router-id changed" warning is a bit long.
Shorten it to better match the style of other log messages.

ok jca@

Revision 1.106 / (download) - annotate - [select for diffs], Mon Mar 25 20:38:54 2019 UTC (5 years, 2 months ago) by jca
Branch: MAIN
Changes since 1.105: +8 -2 lines
Diff to previous 1.105 (colored)

Abort reload if router-id changed

Additional code would be needed to support actually changing the
router-id at runtime; for now be consistent and reject the new
configuration to avoid users a "wtf" moment.

From Mitchell Krome, input from benno@ and deraadt@, ok benno@

Revision 1.105 / (download) - annotate - [select for diffs], Tue Jan 15 22:18:10 2019 UTC (5 years, 4 months ago) by remi
Branch: MAIN
Changes since 1.104: +12 -7 lines
Diff to previous 1.104 (colored)

For external LSAs the type (1 or 2) is encoded in the metric field. Do not
overwrite this when using "redistribute X set type 2 depend on ifX" and ifX
is down.

Problem reported for ospfd by Igor Podlesny.

ok benno@

Revision 1.104 / (download) - annotate - [select for diffs], Mon Jan 14 16:50:56 2019 UTC (5 years, 4 months ago) by florian
Branch: MAIN
Changes since 1.103: +2 -2 lines
Diff to previous 1.103 (colored)

Improve error message when daemon is already running.
OK millert, deraadt, job

Revision 1.103 / (download) - annotate - [select for diffs], Wed Jan 2 18:47:59 2019 UTC (5 years, 4 months ago) by remi
Branch: MAIN
Changes since 1.102: +3 -2 lines
Diff to previous 1.102 (colored)

Send a router LSA update when an interface was removed.

OK claudio@

Revision 1.102 / (download) - annotate - [select for diffs], Fri Dec 28 19:25:10 2018 UTC (5 years, 5 months ago) by remi
Branch: MAIN
Changes since 1.101: +12 -2 lines
Diff to previous 1.101 (colored)

Add config option fib-priority to set a custom prio for routes ospfd
inserts into the kernel routing table.

OK claudio@

Revision 1.101 / (download) - annotate - [select for diffs], Mon Oct 29 22:13:33 2018 UTC (5 years, 7 months ago) by remi
Branch: MAIN
Changes since 1.100: +8 -1 lines
Diff to previous 1.100 (colored)

The parent process of ospfd is not supposed to write or execute files.
Unveil "/" readonly and allow to cleanup the control socket on exit.

Just unveiling ospfd.conf is not possible since it can contain an arbitrary
number of includes.

ok benno@

Revision 1.100 / (download) - annotate - [select for diffs], Wed Aug 29 08:43:17 2018 UTC (5 years, 9 months ago) by remi
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.99: +16 -1 lines
Diff to previous 1.99 (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.99 / (download) - annotate - [select for diffs], Wed Jul 11 12:09:34 2018 UTC (5 years, 10 months ago) by remi
Branch: MAIN
Changes since 1.98: +9 -3 lines
Diff to previous 1.98 (colored)

Change the control socket to ospfd.sock.<rdomain>.

ok friehm@ jca@

Revision 1.98 / (download) - annotate - [select for diffs], Mon Jul 9 13:19:46 2018 UTC (5 years, 10 months ago) by remi
Branch: MAIN
Changes since 1.97: +2 -2 lines
Diff to previous 1.97 (colored)

Set log_setverbose(1) early to see debug logs during parsing the config
but only when -v is used.

ok jca@ claudio@

Revision 1.97 / (download) - annotate - [select for diffs], Sun Feb 11 02:27:33 2018 UTC (6 years, 3 months ago) by benno
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3
Changes since 1.96: +4 -3 lines
Diff to previous 1.96 (colored)

Use the new route filter ROUTE_PRIOFILTER in ospfd. Usually we only
need to see routes with a higher priority (lower value) than ospfds
own routes.
ok claudio, ok henning previous version, feedback from sthen

Revision 1.96 / (download) - annotate - [select for diffs], Fri Feb 9 22:52:54 2018 UTC (6 years, 3 months ago) by jca
Branch: MAIN
Changes since 1.95: +4 -5 lines
Diff to previous 1.95 (colored)

Style tweaks

ok remi@ benno@

Revision 1.95 / (download) - annotate - [select for diffs], Mon Feb 5 12:11:28 2018 UTC (6 years, 3 months ago) by remi
Branch: MAIN
Changes since 1.94: +37 -8 lines
Diff to previous 1.94 (colored)

Introduce "depend on". This allows ospfd to set the metric dependent
on the status of another interface.

in collaboration with benno@ jca@
OK benno@ jca@

Revision 1.94 / (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_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.93: +8 -7 lines
Diff to previous 1.93 (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.93 / (download) - annotate - [select for diffs], Wed Sep 28 14:39:52 2016 UTC (7 years, 8 months ago) by krw
Branch: MAIN
Changes since 1.92: +2 -2 lines
Diff to previous 1.92 (colored)

'unneded stuff' -> 'unneeded stuff' in comments.

Revision 1.92 / (download) - annotate - [select for diffs], Sun Sep 4 10:10:23 2016 UTC (7 years, 8 months ago) by krw
Branch: MAIN
Changes since 1.91: +2 -2 lines
Diff to previous 1.91 (colored)

A few bits of stray leading/embedded/trailing whitespace spotted while
stealing code.

Revision 1.91 / (download) - annotate - [select for diffs], Sat Sep 3 10:22:57 2016 UTC (7 years, 8 months ago) by renato
Branch: MAIN
Changes since 1.90: +22 -57 lines
Diff to previous 1.90 (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 benno@ claudio@

Revision 1.90 / (download) - annotate - [select for diffs], Fri Sep 2 14:02:48 2016 UTC (7 years, 9 months ago) by benno
Branch: MAIN
Changes since 1.89: +2 -1 lines
Diff to previous 1.89 (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.

ok claudio@, feedback from henning@, deraadt@, reyk@

Revision 1.89 / (download) - annotate - [select for diffs], Tue Feb 2 17:51:11 2016 UTC (8 years, 4 months ago) by sthen
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.88: +1 -4 lines
Diff to previous 1.88 (colored)

Remove setproctitle() for the parent process. Because rc.d(8) uses process
titles (including flags) to distinguish between daemons, this makes it
possible to manage multiple copies of a daemon using the normal infrastructure
by symlinking rc.d scripts to a new name. ok jung@ ajacoutot@, smtpd ok gilles@

Revision 1.88 / (download) - annotate - [select for diffs], Sat Dec 5 12:20:13 2015 UTC (8 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.87: +3 -4 lines
Diff to previous 1.87 (colored)

Pledge ospfd SE ("stdio inet mcast") and RDE ("stdio") move some code
around to make it possible. Parent can't be pledged at the moment because
of carp ioctl (carp demote). Putting it in so that people can test.
OK benno@

Revision 1.87 / (download) - annotate - [select for diffs], Thu Dec 3 11:41:06 2015 UTC (8 years, 6 months ago) by claudio
Branch: MAIN
Changes since 1.86: +3 -3 lines
Diff to previous 1.86 (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.86 / (download) - annotate - [select for diffs], Sun Sep 27 17:31:50 2015 UTC (8 years, 8 months ago) by stsp
Branch: MAIN
Changes since 1.85: +2 -2 lines
Diff to previous 1.85 (colored)

As done for bgpd recently, rename if_mediatype to if_type in ospfd/ospf6d.
And some ifmedia64 fixes.
"move forward" deraadt@

Revision 1.85 / (download) - annotate - [select for diffs], Mon Jul 20 23:45:39 2015 UTC (8 years, 10 months ago) by benno
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.84: +5 -3 lines
Diff to previous 1.84 (colored)

Fix a segfault at startup when if_change() ist called before
imsg_init() exposed by the second part of this diff which makes
carp(4) interfaces be recognized to be in "backup" mode on start-up.

Problem analyzed and fix provided by Johan Ymerson, thanks!

ok claudio@, mpi@

Revision 1.84 / (download) - annotate - [select for diffs], Sat Mar 14 02:22:09 2015 UTC (9 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.83: +3 -1 lines
Diff to previous 1.83 (colored)

When removing interfaces in the RDE we also need to remove all the RDE
neighbors that are part of that interface or we open us up to use after
free situations like the one found by sthen@.
Diff makes sense sthen@

Revision 1.83 / (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_7_BASE, OPENBSD_5_7
Changes since 1.82: +7 -11 lines
Diff to previous 1.82 (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.82 / (download) - annotate - [select for diffs], Fri Jan 16 06:40:19 2015 UTC (9 years, 4 months ago) by deraadt
Branch: MAIN
Changes since 1.81: +1 -2 lines
Diff to previous 1.81 (colored)

Replace <sys/param.h> with <limits.h> and other less dirty headers where
possible.  Annotate <sys/param.h> lines with their current reasons.  Switch
to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc.  Change
MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where
sensible to avoid pulling in the pollution.  These are the files confirmed
through binary verification.
ok guenther, millert, doug (helped with the verification protocol)

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

Close connections when msgbuf_write() returns 0.

ok claudio@

Revision 1.80 / (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.79: +3 -3 lines
Diff to previous 1.79 (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.79 / (download) - annotate - [select for diffs], Fri Mar 22 11:29:01 2013 UTC (11 years, 2 months ago) by sthen
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.78: +2 -2 lines
Diff to previous 1.78 (colored)

whitespace tweak; gratuitous difference with ospf6d

Revision 1.78 / (download) - annotate - [select for diffs], Sat Aug 20 11:16:09 2011 UTC (12 years, 9 months ago) by sthen
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
Changes since 1.77: +3 -2 lines
Diff to previous 1.77 (colored)

Decouple log_verbose() from log_init() so the verbose flag stays set with
"ospfd -v" (previously only "-vd" worked). Feedback on earlier implementation
from henning@ blambert@ claudio@, ok claudio@

Revision 1.77 / (download) - annotate - [select for diffs], Fri May 6 13:50:37 2011 UTC (13 years ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.76: +2 -3 lines
Diff to previous 1.76 (colored)

Do not special case loopback interfaces on init. Instead force them
to IF_STA_LOOPBACK in if_act_start() this way they will repsect
IFF_UP on startup. Also remove a now no longer needed workaround
when reloading interfaces.
Initial diff provided by Patrick Coleman. OK dlg@

Revision 1.76 / (download) - annotate - [select for diffs], Thu Mar 24 08:35:59 2011 UTC (13 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.75: +7 -2 lines
Diff to previous 1.75 (colored)

Fix some memory leaks. Mainly better cleanup on shutdown but the v_nexthop
leak is a runtime one.
OK bluhm@

Revision 1.75 / (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.74: +2 -2 lines
Diff to previous 1.74 (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.74 / (download) - annotate - [select for diffs], Fri May 14 08:30:18 2010 UTC (14 years ago) by sthen
Branch: MAIN
CVS Tags: OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.73: +3 -2 lines
Diff to previous 1.73 (colored)

When merging interfaces after a config reload, the fsm state for interfaces
is forced into IF_STA_NEW so that if_init() can be called to setup timers etc.
When a loopback interface is added to the config, this means there's no way
to get to the correct state.

Fix by avoiding changing an existing IF_STA_LOOPBACK and forcing loopback
interfaces to be passive (otherwise skipping the if_init on an active
interface causes problems).

ok claudio@

Revision 1.73 / (download) - annotate - [select for diffs], Fri Feb 19 10:35:52 2010 UTC (14 years, 3 months ago) by dlg
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.72: +3 -0 lines
Diff to previous 1.72 (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.72 / (download) - annotate - [select for diffs], Tue Feb 16 18:16:40 2010 UTC (14 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.71: +6 -4 lines
Diff to previous 1.71 (colored)

Only merge interfaces that have the same address and netmask. Fixes a bug
with reloads when running ospfd on multiple aliases on the same interface.
Is also needed to handle interface address changes in a much better way.
OK dlg@, sthen@

Revision 1.71 / (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.70: +8 -3 lines
Diff to previous 1.70 (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.70 / (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.69: +50 -43 lines
Diff to previous 1.69 (colored)

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

"looks ok" claudio@

Revision 1.69 / (download) - annotate - [select for diffs], Fri Jun 5 19:33:59 2009 UTC (14 years, 11 months ago) by pyr
Branch: MAIN
Changes since 1.68: +17 -5 lines
Diff to previous 1.68 (colored)

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

Revision 1.68 / (download) - annotate - [select for diffs], Fri Jun 5 04:12:52 2009 UTC (15 years ago) by claudio
Branch: MAIN
Changes since 1.67: +3 -2 lines
Diff to previous 1.67 (colored)

Preliminary rdomain support, all hacked up by reyk@

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

Remove redundant imsg_event_add calls; ok claudio@

Revision 1.66 / (download) - annotate - [select for diffs], Sun May 31 16:58:54 2009 UTC (15 years ago) by claudio
Branch: MAIN
Changes since 1.65: +7 -15 lines
Diff to previous 1.65 (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.65 / (download) - annotate - [select for diffs], Fri May 15 15:55:07 2009 UTC (15 years ago) by mpf
Branch: MAIN
Changes since 1.64: +7 -4 lines
Diff to previous 1.64 (colored)

Do not ignore the route metric for "redistribute default".
Got broken in -r 1.62. Pointed out by bluhm@
OK bluhm@, claudio@

Revision 1.64 / (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.63: +11 -4 lines
Diff to previous 1.63 (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.63 / (download) - annotate - [select for diffs], Fri Mar 27 14:37:26 2009 UTC (15 years, 2 months ago) by michele
Branch: MAIN
Changes since 1.62: +11 -6 lines
Diff to previous 1.62 (colored)

Allow the announcement of default route also via redistribute 0.0.0.0/0
and route labels.

ok claudio@

Revision 1.62 / (download) - annotate - [select for diffs], Tue Mar 24 19:26:13 2009 UTC (15 years, 2 months ago) by michele
Branch: MAIN
Changes since 1.61: +14 -28 lines
Diff to previous 1.61 (colored)

Change the behaviour of redistribute default.
Now a default route have to be present in the fib to be correctly advertised.

Spotted and tested by Steven Surdok on ripd.
ok claudio@

Revision 1.61 / (download) - annotate - [select for diffs], Sun Mar 1 16:03:12 2009 UTC (15 years, 3 months ago) by michele
Branch: MAIN
Changes since 1.60: +5 -5 lines
Diff to previous 1.60 (colored)

Print the correct function name in log_debug().

OK claudio@ stsp@

Revision 1.60 / (download) - annotate - [select for diffs], Wed Jan 7 21:16:36 2009 UTC (15 years, 4 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.59: +43 -12 lines
Diff to previous 1.59 (colored)

Full stub area support. This allows ABRs to announce a default network
summary LSA into stub areas so that these routers are able to reach the
outside of the area.
OK norby@

Revision 1.59 / (download) - annotate - [select for diffs], Thu Jan 1 20:44:06 2009 UTC (15 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.58: +5 -2 lines
Diff to previous 1.58 (colored)

Call kr_shutdown() before exit even in config test mode and config parse
error case.

Revision 1.58 / (download) - annotate - [select for diffs], Mon Nov 24 18:28:02 2008 UTC (15 years, 6 months ago) by claudio
Branch: MAIN
Changes since 1.57: +5 -1 lines
Diff to previous 1.57 (colored)

Initial support for stub areas. The bit still missing is the redistribution
of the default summary net lsa on ABRs but that is comming. OK norby@

Revision 1.57 / (download) - annotate - [select for diffs], Mon May 12 19:15:02 2008 UTC (16 years ago) by pyr
Branch: MAIN
CVS Tags: OPENBSD_4_4_BASE, OPENBSD_4_4
Changes since 1.56: +6 -1 lines
Diff to previous 1.56 (colored)

Error out with usage line if additional arguments are given after the
option parsing. Found out the hard way by jdixon on ifstated.

ok sobrado@, jdixon@, millert@

Revision 1.56 / (download) - annotate - [select for diffs], Thu Oct 25 12:06:30 2007 UTC (16 years, 7 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_4_3_BASE, OPENBSD_4_3
Changes since 1.55: +9 -3 lines
Diff to previous 1.55 (colored)

Add -D makro=value as well so that all routing daemons are in sync.
OK norby@

Revision 1.55 / (download) - annotate - [select for diffs], Sat Oct 20 13:29:44 2007 UTC (16 years, 7 months ago) by pyr
Branch: MAIN
Changes since 1.54: +5 -4 lines
Diff to previous 1.54 (colored)

forgot about ospfd in last commit.
ok hennin@ too.

Revision 1.54 / (download) - annotate - [select for diffs], Sun Oct 14 19:35:01 2007 UTC (16 years, 7 months ago) by claudio
Branch: MAIN
Changes since 1.53: +2 -2 lines
Diff to previous 1.53 (colored)

Missing space

Revision 1.53 / (download) - annotate - [select for diffs], Sat Oct 13 16:35:22 2007 UTC (16 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.52: +1 -25 lines
Diff to previous 1.52 (colored)

in all these programs using the same pfctl-derived parse.y, re-unify the
yylex implementation and the code which interacts with yylex.  this also
brings the future potential for include support to all of the parsers.
in the future please do not silly modifications to one of these files
without checking if you are de-unifying the code.
checked by developers in all these areas.

Revision 1.52 / (download) - annotate - [select for diffs], Thu Oct 11 12:16:45 2007 UTC (16 years, 7 months ago) by claudio
Branch: MAIN
Changes since 1.51: +1 -5 lines
Diff to previous 1.51 (colored)

Don't check for OSPF_OPTION_E in the parent. OSPF_OPTION_E is per area and
so the parent process has no way to know if it should redistribute or not.
Let the RDE decide. OK norby@

Revision 1.51 / (download) - annotate - [select for diffs], Mon Oct 1 08:35:12 2007 UTC (16 years, 8 months ago) by norby
Branch: MAIN
Changes since 1.50: +7 -5 lines
Diff to previous 1.50 (colored)

fix alot of whitespace problems...

Revision 1.50 / (download) - annotate - [select for diffs], Tue Sep 25 11:25:41 2007 UTC (16 years, 8 months ago) by claudio
Branch: MAIN
Changes since 1.49: +5 -3 lines
Diff to previous 1.49 (colored)

Last missing piece in the equal cost multipath support for ospfd.
Send all possible nexthops to the parent process and correctly sync
the RIB, FIB and kernel routing table. Based on initial work by pyr@.
OK pyr@ norby@
PS: don't forget that you need to enable multipath support via a sysctl

Revision 1.49 / (download) - annotate - [select for diffs], Tue Sep 18 16:59:08 2007 UTC (16 years, 8 months ago) by claudio
Branch: MAIN
Changes since 1.48: +6 -2 lines
Diff to previous 1.48 (colored)

Correctly track the E-bit of router LSA on config reloads. If redistribution
is turned on or off the E-bit needs to be toggled accordingly else the
AS-external LSA are ignored by the other OSPF routers.
OK norby@

Revision 1.48 / (download) - annotate - [select for diffs], Wed Jul 25 19:11:27 2007 UTC (16 years, 10 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_4_2_BASE, OPENBSD_4_2
Changes since 1.47: +19 -5 lines
Diff to previous 1.47 (colored)

Don't fatal if the imsg pipe is closed, this is often triggered in the parent
and hides the real cause of the termination.
OK norby@, reyk@, pyr@

Revision 1.47 / (download) - annotate - [select for diffs], Tue Jun 19 14:42:09 2007 UTC (16 years, 11 months ago) by pyr
Branch: MAIN
Changes since 1.46: +5 -3 lines
Diff to previous 1.46 (colored)

Allow ospfd reconfiguration through SIGHUP, add SIGHUP handlers in
children like in bgpd so that ``pkill -1 ospfd'' works as expected.

ok claudio@

Revision 1.46 / (download) - annotate - [select for diffs], Tue May 29 22:08:25 2007 UTC (17 years ago) by claudio
Branch: MAIN
Changes since 1.45: +15 -3 lines
Diff to previous 1.45 (colored)

Demote support for ospfd. It is possible to specify a demote group on
interfaces and areas. With this carp setups using ospfd are more reliable
because we can fail over if the OSPF connectivity is (partially) lost.
OK norby@

Revision 1.45 / (download) - annotate - [select for diffs], Sun Mar 25 15:48:54 2007 UTC (17 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.44: +16 -5 lines
Diff to previous 1.44 (colored)

If the interface metric changes on reload it is necessary to re-originate
the router LSA so that the change propagates instantly. Call orig_rtr_lsa()
in merge_config() if a interface in an area changes. Do it as late as possible
to reduce the amount of updates generated by a config reload.
Found and tested by Stuart Henderson. OK norby@

Revision 1.44 / (download) - annotate - [select for diffs], Wed Mar 21 10:54:30 2007 UTC (17 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.43: +9 -4 lines
Diff to previous 1.43 (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.43 / (download) - annotate - [select for diffs], Sat Mar 17 22:28:58 2007 UTC (17 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.42: +2 -2 lines
Diff to previous 1.42 (colored)

Exchange a strlcpy() with a strncpy(). A similar change was done in parse.y
some time ago. The simple password needs to be nul extended and is allowed
to fill the full buffer the perfect job for stncpy().
Found and tested by Jon Morby.

Revision 1.42 / (download) - annotate - [select for diffs], Fri Mar 16 10:56:31 2007 UTC (17 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.41: +4 -2 lines
Diff to previous 1.41 (colored)

Don't forget to set the metric in the REDIST_LABEL case. OK pyr@

Revision 1.41 / (download) - annotate - [select for diffs], Thu Feb 1 13:25:28 2007 UTC (17 years, 4 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_4_1_BASE, OPENBSD_4_1
Changes since 1.40: +3 -4 lines
Diff to previous 1.40 (colored)

whitespace cleanup, no binary change.

Revision 1.40 / (download) - annotate - [select for diffs], Thu Feb 1 13:02:04 2007 UTC (17 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.39: +260 -25 lines
Diff to previous 1.39 (colored)

Preliminary configuration reload support. Seems to work reasonably well
after fixing many use-after-free errors a couple of days ago.
Most cases -- adding/removing of interfaces, adding/removing of areas --
seem to work. Still merge_config() is a behemoth of a function and some
edge cases may not be covered correctly (yet).
OK norby@ pyr@

Revision 1.39 / (download) - annotate - [select for diffs], Sat Jan 20 17:13:36 2007 UTC (17 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.38: +2 -1 lines
Diff to previous 1.38 (colored)

Ignore SIGPIPE in the parent and RDE as well.

Revision 1.38 / (download) - annotate - [select for diffs], Thu Dec 21 17:22:29 2006 UTC (17 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.37: +8 -5 lines
Diff to previous 1.37 (colored)

Unbreak redistribute default and make it possible to specify a metric for
the default route as well. OK norby@, michele@

Revision 1.37 / (download) - annotate - [select for diffs], Thu Dec 7 19:14:27 2006 UTC (17 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.36: +11 -5 lines
Diff to previous 1.36 (colored)

Make it possible to set the metric and LSA type for redistributed routes.
Mostly based on a diff by Pierre-Yves Ritschard (I just simplified the parser
code). OK norby@

Revision 1.36 / (download) - annotate - [select for diffs], Wed Nov 1 13:20:18 2006 UTC (17 years, 7 months ago) by claudio
Branch: MAIN
Changes since 1.35: +2 -2 lines
Diff to previous 1.35 (colored)

Fix copy pasto, use SIGCHLD for the sigchild handler not SIGINT twice.
Spotted by janus <at> errornet.de

Revision 1.35 / (download) - annotate - [select for diffs], Sun Aug 6 12:35:44 2006 UTC (17 years, 10 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_4_0_BASE, OPENBSD_4_0
Changes since 1.34: +2 -4 lines
Diff to previous 1.34 (colored)

There is no need to initialize the log framework twice. Especially because
between the two calls no logging can happen.

Revision 1.34 / (download) - annotate - [select for diffs], Mon Jul 3 13:05:02 2006 UTC (17 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.33: +3 -1 lines
Diff to previous 1.33 (colored)

Add missing breaks and suddenly all starts to make sense again. Wondered
why one of my boxes started to redistribute all my bgpd routes into ospf.

Revision 1.33 / (download) - annotate - [select for diffs], Wed May 31 03:24:06 2006 UTC (18 years ago) by claudio
Branch: MAIN
Changes since 1.32: +11 -6 lines
Diff to previous 1.32 (colored)

More redistribute fun. Add a possibility to deny redistribution of specified
routes via "no redistribute rtlabel admin". Redistribute rules are parsed
in order and the first match is used. Only exception is "redistribute default"
Which is independent of the other rules and can't be negated.

Revision 1.32 / (download) - annotate - [select for diffs], Tue May 30 22:06:14 2006 UTC (18 years ago) by claudio
Branch: MAIN
Changes since 1.31: +30 -8 lines
Diff to previous 1.31 (colored)

Now that rtlabels are accessable via sysctl we can use route lables to
define which routes should be redistributed via OSPF. So now you can
define the export list on a fine graded basis. More to come... OK norby@

Revision 1.31 / (download) - annotate - [select for diffs], Mon Mar 27 11:57:24 2006 UTC (18 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.30: +2 -2 lines
Diff to previous 1.30 (colored)

More specific warning.

Revision 1.30 / (download) - annotate - [select for diffs], Sat Mar 25 09:34:13 2006 UTC (18 years, 2 months ago) by norby
Branch: MAIN
Changes since 1.29: +17 -1 lines
Diff to previous 1.29 (colored)

Highlight that running an OSPF router without forwarding enabled is
very damaging to the network.

ok claudio@

Revision 1.29 / (download) - annotate - [select for diffs], Tue Mar 14 16:14:30 2006 UTC (18 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.28: +1 -2 lines
Diff to previous 1.28 (colored)

Kill unneeded util.h include.

Revision 1.28 / (download) - annotate - [select for diffs], Wed Mar 8 16:02:59 2006 UTC (18 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.27: +6 -5 lines
Diff to previous 1.27 (colored)

Cleanup with lint. Kill unused variable and fix some types.

Revision 1.27 / (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.26: +3 -5 lines
Diff to previous 1.26 (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.26 / (download) - annotate - [select for diffs], Thu Jan 12 15:10:02 2006 UTC (18 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.25: +38 -1 lines
Diff to previous 1.25 (colored)

Rewrite the redistribute code. The previous implementation was stupid and
resulted in a major bottleneck if bgpd was used on the same box -- not clever
to do linear searches over 175k entries :(. This now moves the redistribute
code back into kroute duty and kills the linear list. Also default routes are
now redistributed without the need for a kernel default route.
OK norby@

Revision 1.25 / (download) - annotate - [select for diffs], Thu Dec 29 13:58:49 2005 UTC (18 years, 5 months ago) by claudio
Branch: MAIN
Changes since 1.24: +9 -2 lines
Diff to previous 1.24 (colored)

More correct cleanup on exit. OK norby@

Revision 1.24 / (download) - annotate - [select for diffs], Tue Oct 18 15:40:36 2005 UTC (18 years, 7 months ago) by claudio
Branch: MAIN
Changes since 1.23: +1 -2 lines
Diff to previous 1.23 (colored)

Cleanup interface code a minimal bit. There is no need for if_shutdown(),
especially it got called in the wrong place.  OK norby@

Revision 1.23 / (download) - annotate - [select for diffs], Mon Aug 15 18:58:47 2005 UTC (18 years, 9 months ago) by norby
Branch: MAIN
CVS Tags: OPENBSD_3_8_BASE, OPENBSD_3_8
Changes since 1.22: +3 -3 lines
Diff to previous 1.22 (colored)

Fix possible race condition in signal handler.

Report and fix from Micheal Knudsen.

Prep, test and OK claudio@

Revision 1.22 / (download) - annotate - [select for diffs], Tue Jun 21 19:10:22 2005 UTC (18 years, 11 months ago) by claudio
Branch: MAIN
Changes since 1.21: +2 -2 lines
Diff to previous 1.21 (colored)

The ev_sighup event handler should handle SIGHUP and not SIGTERM.
SIGTERM is already handled by ev_sigterm.

Revision 1.21 / (download) - annotate - [select for diffs], Thu May 26 22:05:14 2005 UTC (19 years ago) by norby
Branch: MAIN
Changes since 1.20: +2 -3 lines
Diff to previous 1.20 (colored)

Cleanup.

Revision 1.20 / (download) - annotate - [select for diffs], Thu May 26 18:46:16 2005 UTC (19 years ago) by norby
Branch: MAIN
Changes since 1.19: +25 -10 lines
Diff to previous 1.19 (colored)

Support dumping the configuration the way bgpd(8) does it.

This makes it possible to have ospfd(8) parse a configuration file and
display the parsed result.

ok claudio@

Revision 1.19 / (download) - annotate - [select for diffs], Mon May 23 22:54:05 2005 UTC (19 years ago) by henning
Branch: MAIN
Changes since 1.18: +1 -3 lines
Diff to previous 1.18 (colored)

useless use of endpwent

Revision 1.18 / (download) - annotate - [select for diffs], Mon Apr 25 09:28:45 2005 UTC (19 years, 1 month ago) by claudio
Branch: MAIN
Changes since 1.17: +1 -6 lines
Diff to previous 1.17 (colored)

Call if_init() in ospfe only, neither the rde nor the parent need it.

Revision 1.17 / (download) - annotate - [select for diffs], Tue Apr 19 07:34:52 2005 UTC (19 years, 1 month ago) by claudio
Branch: MAIN
Changes since 1.16: +3 -3 lines
Diff to previous 1.16 (colored)

Don't call event_set() before event_init().
OK norby@

Revision 1.16 / (download) - annotate - [select for diffs], Sun Apr 17 21:50:18 2005 UTC (19 years, 1 month ago) by claudio
Branch: MAIN
Changes since 1.15: +2 -2 lines
Diff to previous 1.15 (colored)

Use fatalx() instead of ospfd_shutdown() if kr_init() fails.
OK henning@

Revision 1.15 / (download) - annotate - [select for diffs], Sat Mar 26 13:53:51 2005 UTC (19 years, 2 months ago) by henning
Branch: MAIN
Changes since 1.14: +3 -3 lines
Diff to previous 1.14 (colored)

explciitely 0-initialize pids

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

Prototypes where moved to ospfd.h so no need to keep them here.

Revision 1.13 / (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.12: +6 -4 lines
Diff to previous 1.12 (colored)

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

Revision 1.12 / (download) - annotate - [select for diffs], Sat Mar 26 11:04:28 2005 UTC (19 years, 2 months ago) by henning
Branch: MAIN
Changes since 1.11: +7 -3 lines
Diff to previous 1.11 (colored)

fix a little race on SIGCHLD where we must delay the claenup until
we invalidated all child pids in case both were killed in a very short
time, spotted by and diff from Michael Knudsen <e@molioner.dk>, claudio ok

Revision 1.11 / (download) - annotate - [select for diffs], Fri Mar 25 13:39:10 2005 UTC (19 years, 2 months ago) by henning
Branch: MAIN
Changes since 1.10: +2 -2 lines
Diff to previous 1.10 (colored)

what is an ospfe engine?

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

extra char in getopt string, Michael Knudsen <e@molioner.dk>

Revision 1.9 / (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.8: +11 -1 lines
Diff to previous 1.8 (colored)

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

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

Remove no longer valid route entries.

ok claudio@

Revision 1.7 / (download) - annotate - [select for diffs], Mon Mar 7 10:28:14 2005 UTC (19 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.6: +4 -1 lines
Diff to previous 1.6 (colored)

Track interface state (up/down) and media status. Simplify the code a bit
by using the kif/kroute info while allocating interfaces.

Revision 1.6 / (download) - annotate - [select for diffs], Sun Feb 27 08:21:15 2005 UTC (19 years, 3 months ago) by norby
Branch: MAIN
Changes since 1.5: +5 -1 lines
Diff to previous 1.5 (colored)

SPF and route table calculation.

Calculate Shortest Path Tree for each area known in the link state
database.

The Shortest Path Tree is used as input for route table calculation.
Route tabled is calculated and the result is inserted into the kernel
route table.

ok claudio@

Revision 1.5 / (download) - annotate - [select for diffs], Thu Feb 24 16:28:43 2005 UTC (19 years, 3 months ago) by claudio
Branch: MAIN
Changes since 1.4: +1 -28 lines
Diff to previous 1.4 (colored)

Remove the kroute nexthop specific code as there is no need for this in
ospfd. While there clean up some other no longer needed stuff.
OK norby@

Revision 1.4 / (download) - annotate - [select for diffs], Mon Feb 7 05:51:00 2005 UTC (19 years, 3 months ago) by david
Branch: MAIN
Changes since 1.3: +2 -2 lines
Diff to previous 1.3 (colored)

spelling fixes

Revision 1.3 / (download) - annotate - [select for diffs], Wed Feb 2 18:52:32 2005 UTC (19 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.2: +6 -6 lines
Diff to previous 1.2 (colored)

usage() is __dead
pt out by Alexander v Gernler

Revision 1.2 / (download) - annotate - [select for diffs], Fri Jan 28 17:53:33 2005 UTC (19 years, 4 months ago) by norby
Branch: MAIN
Changes since 1.1: +2 -2 lines
Diff to previous 1.1 (colored)

Change my email address to the OpenBSD one since Ericsson has nothing to
do with this software, just happend to be my only valid email address at
the time.

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.