History log of /openbsd-current/usr.sbin/ripd/control.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.28 08-Mar-2023 guenther

Delete obsolete /* ARGSUSED */ lint comments.

ok miod@ millert@


Revision tags: OPENBSD_6_9_BASE OPENBSD_7_0_BASE OPENBSD_7_1_BASE OPENBSD_7_2_BASE
# 1.27 19-Jan-2021 claudio

Apply same cleanup to the control code as in ospfd.
Internalize control_state and ctl_conns.


Revision tags: OPENBSD_6_5_BASE OPENBSD_6_6_BASE OPENBSD_6_7_BASE OPENBSD_6_8_BASE
# 1.26 04-Nov-2018 remi

Pledge ripe and rde.
Use unveil to remove file system access for the parent proc.

Also remove control_cleanup as discussed on tech@. It allows to fully remove
fs access (ripd does not support reload). It's not an issue for ripd and
ripctrl if an unused socket file is lying around.

reads OK for claudio@ and mestre@


Revision tags: OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE
# 1.25 17-Jan-2017 krw

Nuke some whitespace that keeps poking me in the eye as I try to
steal code.


# 1.24 08-Jan-2017 krw

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

No intentional functional change.

ok reyk@


# 1.23 02-Aug-2016 jca

Allow specifying an alternate socket path.

This allows one to run multiple ripd instances, for example to serve
multiple rdomains. Diff from Nima GHOTBI, ok claudio@ florian@ benno@


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.22 05-Dec-2015 claudio

EAGAIN handling for imsg_read. OK henning@ benno@


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.21 09-Feb-2015 claudio

More session_socket_blockmode() removal. While there make the main UDP
socket non-blocking by default.


Revision tags: OPENBSD_5_6_BASE
# 1.20 11-Jul-2014 krw

Close the control fd when it has reported EOF.

ok henning@


Revision tags: OPENBSD_5_5_BASE
# 1.19 19-Nov-2013 benno

handle msgbuf_write() returning EAGAIN

"looks right" deraadt and sthen.


Revision tags: OPENBSD_5_4_BASE
# 1.18 11-Mar-2013 deraadt

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 tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.17 11-Apr-2012 deraadt

delete excessive evtimer_pending; ok claudio


# 1.16 10-Apr-2012 deraadt

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


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE
# 1.15 14-May-2010 claudio

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 tags: OPENBSD_4_7_BASE
# 1.14 21-Feb-2010 michele

Kill double declaration of control_imsg_relay().

From Christiano F. Haesbaert.

ok claudio@


# 1.13 08-Dec-2009 jsg

porcesses -> processes


# 1.12 02-Dec-2009 mk

log_warn() consistency.

`OK' claudio


# 1.11 02-Nov-2009 claudio

Another routing daemon that gets IMSG_CTL_LOG_VERBOSE to allow toggeling of
log_debug(). ok michele, henning, sthen


Revision tags: OPENBSD_4_6_BASE
# 1.10 06-Jun-2009 eric

make ripctl/ripd imsg-in-a-lib ready too.

ok pyr@


# 1.9 31-May-2009 jacekm

Remove redundant imsg_event_add calls; ok claudio@


# 1.8 31-May-2009 claudio

Better EV_READ and EV_WRITE handling in the libevent callbacks. Again mostly
the same ospfd diff applied with some fuzz.


Revision tags: OPENBSD_4_5_BASE
# 1.7 25-Feb-2009 claudio

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 tags: OPENBSD_4_3_BASE OPENBSD_4_4_BASE
# 1.6 31-Jan-2008 henning

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


# 1.5 24-Oct-2007 claudio

Use an ssize_t instead of int like in all other imsg handlers. Hint by lint


# 1.4 17-Oct-2007 claudio

Remove redundant code.


Revision tags: OPENBSD_4_2_BASE
# 1.3 19-Mar-2007 henning

do not signal "connection closed" upstream on EINTR/EAGAIN, from bgpd et al


Revision tags: OPENBSD_4_1_BASE
# 1.2 23-Jan-2007 claudio

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


# 1.1 18-Oct-2006 norby

Welcome ripd
started by Michele Marchetto some time ago by using the imsg/three process framework
of ospfd. He implemented most of the daemon with a little help and guidance from
Claudio and I.

Currently the daemon is more or less complete, with the exception of key lifetime
and rollover.

Not yet connected to the builds.
OK claudio@


# 1.27 19-Jan-2021 claudio

Apply same cleanup to the control code as in ospfd.
Internalize control_state and ctl_conns.


Revision tags: OPENBSD_6_5_BASE OPENBSD_6_6_BASE OPENBSD_6_7_BASE OPENBSD_6_8_BASE
# 1.26 04-Nov-2018 remi

Pledge ripe and rde.
Use unveil to remove file system access for the parent proc.

Also remove control_cleanup as discussed on tech@. It allows to fully remove
fs access (ripd does not support reload). It's not an issue for ripd and
ripctrl if an unused socket file is lying around.

reads OK for claudio@ and mestre@


Revision tags: OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE
# 1.25 17-Jan-2017 krw

Nuke some whitespace that keeps poking me in the eye as I try to
steal code.


# 1.24 08-Jan-2017 krw

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

No intentional functional change.

ok reyk@


# 1.23 02-Aug-2016 jca

Allow specifying an alternate socket path.

This allows one to run multiple ripd instances, for example to serve
multiple rdomains. Diff from Nima GHOTBI, ok claudio@ florian@ benno@


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.22 05-Dec-2015 claudio

EAGAIN handling for imsg_read. OK henning@ benno@


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.21 09-Feb-2015 claudio

More session_socket_blockmode() removal. While there make the main UDP
socket non-blocking by default.


Revision tags: OPENBSD_5_6_BASE
# 1.20 11-Jul-2014 krw

Close the control fd when it has reported EOF.

ok henning@


Revision tags: OPENBSD_5_5_BASE
# 1.19 19-Nov-2013 benno

handle msgbuf_write() returning EAGAIN

"looks right" deraadt and sthen.


Revision tags: OPENBSD_5_4_BASE
# 1.18 11-Mar-2013 deraadt

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 tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.17 11-Apr-2012 deraadt

delete excessive evtimer_pending; ok claudio


# 1.16 10-Apr-2012 deraadt

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


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE
# 1.15 14-May-2010 claudio

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 tags: OPENBSD_4_7_BASE
# 1.14 21-Feb-2010 michele

Kill double declaration of control_imsg_relay().

From Christiano F. Haesbaert.

ok claudio@


# 1.13 08-Dec-2009 jsg

porcesses -> processes


# 1.12 02-Dec-2009 mk

log_warn() consistency.

`OK' claudio


# 1.11 02-Nov-2009 claudio

Another routing daemon that gets IMSG_CTL_LOG_VERBOSE to allow toggeling of
log_debug(). ok michele, henning, sthen


Revision tags: OPENBSD_4_6_BASE
# 1.10 06-Jun-2009 eric

make ripctl/ripd imsg-in-a-lib ready too.

ok pyr@


# 1.9 31-May-2009 jacekm

Remove redundant imsg_event_add calls; ok claudio@


# 1.8 31-May-2009 claudio

Better EV_READ and EV_WRITE handling in the libevent callbacks. Again mostly
the same ospfd diff applied with some fuzz.


Revision tags: OPENBSD_4_5_BASE
# 1.7 25-Feb-2009 claudio

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 tags: OPENBSD_4_3_BASE OPENBSD_4_4_BASE
# 1.6 31-Jan-2008 henning

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


# 1.5 24-Oct-2007 claudio

Use an ssize_t instead of int like in all other imsg handlers. Hint by lint


# 1.4 17-Oct-2007 claudio

Remove redundant code.


Revision tags: OPENBSD_4_2_BASE
# 1.3 19-Mar-2007 henning

do not signal "connection closed" upstream on EINTR/EAGAIN, from bgpd et al


Revision tags: OPENBSD_4_1_BASE
# 1.2 23-Jan-2007 claudio

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


# 1.1 18-Oct-2006 norby

Welcome ripd
started by Michele Marchetto some time ago by using the imsg/three process framework
of ospfd. He implemented most of the daemon with a little help and guidance from
Claudio and I.

Currently the daemon is more or less complete, with the exception of key lifetime
and rollover.

Not yet connected to the builds.
OK claudio@


# 1.26 04-Nov-2018 remi

Pledge ripe and rde.
Use unveil to remove file system access for the parent proc.

Also remove control_cleanup as discussed on tech@. It allows to fully remove
fs access (ripd does not support reload). It's not an issue for ripd and
ripctrl if an unused socket file is lying around.

reads OK for claudio@ and mestre@


Revision tags: OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE
# 1.25 17-Jan-2017 krw

Nuke some whitespace that keeps poking me in the eye as I try to
steal code.


# 1.24 08-Jan-2017 krw

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

No intentional functional change.

ok reyk@


# 1.23 02-Aug-2016 jca

Allow specifying an alternate socket path.

This allows one to run multiple ripd instances, for example to serve
multiple rdomains. Diff from Nima GHOTBI, ok claudio@ florian@ benno@


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.22 05-Dec-2015 claudio

EAGAIN handling for imsg_read. OK henning@ benno@


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.21 09-Feb-2015 claudio

More session_socket_blockmode() removal. While there make the main UDP
socket non-blocking by default.


Revision tags: OPENBSD_5_6_BASE
# 1.20 11-Jul-2014 krw

Close the control fd when it has reported EOF.

ok henning@


Revision tags: OPENBSD_5_5_BASE
# 1.19 19-Nov-2013 benno

handle msgbuf_write() returning EAGAIN

"looks right" deraadt and sthen.


Revision tags: OPENBSD_5_4_BASE
# 1.18 11-Mar-2013 deraadt

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 tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.17 11-Apr-2012 deraadt

delete excessive evtimer_pending; ok claudio


# 1.16 10-Apr-2012 deraadt

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


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE
# 1.15 14-May-2010 claudio

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 tags: OPENBSD_4_7_BASE
# 1.14 21-Feb-2010 michele

Kill double declaration of control_imsg_relay().

From Christiano F. Haesbaert.

ok claudio@


# 1.13 08-Dec-2009 jsg

porcesses -> processes


# 1.12 02-Dec-2009 mk

log_warn() consistency.

`OK' claudio


# 1.11 02-Nov-2009 claudio

Another routing daemon that gets IMSG_CTL_LOG_VERBOSE to allow toggeling of
log_debug(). ok michele, henning, sthen


Revision tags: OPENBSD_4_6_BASE
# 1.10 06-Jun-2009 eric

make ripctl/ripd imsg-in-a-lib ready too.

ok pyr@


# 1.9 31-May-2009 jacekm

Remove redundant imsg_event_add calls; ok claudio@


# 1.8 31-May-2009 claudio

Better EV_READ and EV_WRITE handling in the libevent callbacks. Again mostly
the same ospfd diff applied with some fuzz.


Revision tags: OPENBSD_4_5_BASE
# 1.7 25-Feb-2009 claudio

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 tags: OPENBSD_4_3_BASE OPENBSD_4_4_BASE
# 1.6 31-Jan-2008 henning

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


# 1.5 24-Oct-2007 claudio

Use an ssize_t instead of int like in all other imsg handlers. Hint by lint


# 1.4 17-Oct-2007 claudio

Remove redundant code.


Revision tags: OPENBSD_4_2_BASE
# 1.3 19-Mar-2007 henning

do not signal "connection closed" upstream on EINTR/EAGAIN, from bgpd et al


Revision tags: OPENBSD_4_1_BASE
# 1.2 23-Jan-2007 claudio

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


# 1.1 18-Oct-2006 norby

Welcome ripd
started by Michele Marchetto some time ago by using the imsg/three process framework
of ospfd. He implemented most of the daemon with a little help and guidance from
Claudio and I.

Currently the daemon is more or less complete, with the exception of key lifetime
and rollover.

Not yet connected to the builds.
OK claudio@


Revision tags: OPENBSD_6_1_BASE OPENBSD_6_2_BASE
# 1.25 17-Jan-2017 krw

Nuke some whitespace that keeps poking me in the eye as I try to
steal code.


# 1.24 08-Jan-2017 krw

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

No intentional functional change.

ok reyk@


# 1.23 02-Aug-2016 jca

Allow specifying an alternate socket path.

This allows one to run multiple ripd instances, for example to serve
multiple rdomains. Diff from Nima GHOTBI, ok claudio@ florian@ benno@


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.22 05-Dec-2015 claudio

EAGAIN handling for imsg_read. OK henning@ benno@


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.21 09-Feb-2015 claudio

More session_socket_blockmode() removal. While there make the main UDP
socket non-blocking by default.


Revision tags: OPENBSD_5_6_BASE
# 1.20 11-Jul-2014 krw

Close the control fd when it has reported EOF.

ok henning@


Revision tags: OPENBSD_5_5_BASE
# 1.19 19-Nov-2013 benno

handle msgbuf_write() returning EAGAIN

"looks right" deraadt and sthen.


Revision tags: OPENBSD_5_4_BASE
# 1.18 11-Mar-2013 deraadt

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 tags: OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.17 11-Apr-2012 deraadt

delete excessive evtimer_pending; ok claudio


# 1.16 10-Apr-2012 deraadt

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


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE
# 1.15 14-May-2010 claudio

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 tags: OPENBSD_4_7_BASE
# 1.14 21-Feb-2010 michele

Kill double declaration of control_imsg_relay().

From Christiano F. Haesbaert.

ok claudio@


# 1.13 08-Dec-2009 jsg

porcesses -> processes


# 1.12 02-Dec-2009 mk

log_warn() consistency.

`OK' claudio


# 1.11 02-Nov-2009 claudio

Another routing daemon that gets IMSG_CTL_LOG_VERBOSE to allow toggeling of
log_debug(). ok michele, henning, sthen


Revision tags: OPENBSD_4_6_BASE
# 1.10 06-Jun-2009 eric

make ripctl/ripd imsg-in-a-lib ready too.

ok pyr@


# 1.9 31-May-2009 jacekm

Remove redundant imsg_event_add calls; ok claudio@


# 1.8 31-May-2009 claudio

Better EV_READ and EV_WRITE handling in the libevent callbacks. Again mostly
the same ospfd diff applied with some fuzz.


Revision tags: OPENBSD_4_5_BASE
# 1.7 25-Feb-2009 claudio

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 tags: OPENBSD_4_3_BASE OPENBSD_4_4_BASE
# 1.6 31-Jan-2008 henning

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


# 1.5 24-Oct-2007 claudio

Use an ssize_t instead of int like in all other imsg handlers. Hint by lint


# 1.4 17-Oct-2007 claudio

Remove redundant code.


Revision tags: OPENBSD_4_2_BASE
# 1.3 19-Mar-2007 henning

do not signal "connection closed" upstream on EINTR/EAGAIN, from bgpd et al


Revision tags: OPENBSD_4_1_BASE
# 1.2 23-Jan-2007 claudio

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


# 1.1 18-Oct-2006 norby

Welcome ripd
started by Michele Marchetto some time ago by using the imsg/three process framework
of ospfd. He implemented most of the daemon with a little help and guidance from
Claudio and I.

Currently the daemon is more or less complete, with the exception of key lifetime
and rollover.

Not yet connected to the builds.
OK claudio@