Re: login.conf processing by /etc/rc

2016-09-28 Thread Otto Moerbeek
On Thu, Sep 29, 2016 at 12:10:47AM +0300, Evgeny Grin wrote:

> Hi!
> 
> I configured freshly installed OpenBSD 6.0-release with
> 
> kern.maxfiles=131072
> 
> in /etc/sysctl.conf
> and
> 
> :openfiles-max=40960:openfiles-cur=40960:
> 
> for daemon in /etc/login.conf
> 
> And at each boot I see message:
> kern.maxfiles: 7030 -> 131072
> /etc/rc: ulimit: bad -n limit: Invalid argument
> 
> I looked at /etc/rc and found that script at first step call 'ulimit -S
> -n ' for value found for '-cur' and at second step call 'ulimit -H -n '
> for value found for '-max'. That is incorrect as soft limit can't be set
> to higher value than hard limit. Moreover, I can't just use
> ":openfiles=40960:" for daemon class because "default" class has both
> "-max" and "-cur" values - as result: at first step "40960" used for
> both hard and soft limit, but immediately lowered by using "-cur" and
> "-max" values from "default" class (getcap return them for "daemon"
> class as well).
> 
> As current workaround I use
> 
> :openfiles=40960:openfiles-max=40960:openfiles-cur=40960:
> 
> but it is not really elegant solution.
> 
> 
> I this that at least order of suffix checking in /etc/rc must be changed
> from
> "for _suffix in {,-cur,-max}; do"
> to
> "for _suffix in {,-max,-cur}; do"
> 
> 
> Am I right? Or I missed something?
> 
> -- 
> Best Wishes,
> Evgeny Grin

First setting max and then cur should be enough.

Moving this to tech@

-Otto

Index: rc
===
RCS file: /cvs/src/etc/rc,v
retrieving revision 1.486
diff -u -p -r1.486 rc
--- rc  10 Jul 2016 09:08:18 -  1.486
+++ rc  29 Sep 2016 05:05:13 -
@@ -31,7 +31,7 @@ update_limit() {
local _cap=$2 _val  # login.conf capability and its value
local _suffix
 
-   for _suffix in {,-cur,-max}; do
+   for _suffix in {,-max,-cur}; do
_val=$(getcap -f /etc/login.conf -s ${_cap}${_suffix} daemon 
2>/dev/null)
[[ -n $_val ]] || continue
[[ $_val == infinity ]] && _val=unlimited



syslogd iso timestamps

2016-09-28 Thread Alexander Bluhm
Hi,

When doing global remote logging and archiving, it is inconvenient
that the syslog timestamp is missig the year and the timezone, but
has local time with daylight saving time.

RFC 5424 specifies ISO format, but you don't want to read this on
your laptop.  So I made it optional with -Z, default is BSD syslog
timestamp from RFC 3164.

This is how old and new format look like:
Sep 29 01:42:37 t430s syslogd: exiting on signal 15
2016-09-28T23:43:52Z t430s syslogd: start

ok?

bluhm

Index: usr.sbin/syslogd/syslogd.8
===
RCS file: /data/mirror/openbsd/cvs/src/usr.sbin/syslogd/syslogd.8,v
retrieving revision 1.50
diff -u -p -r1.50 syslogd.8
--- usr.sbin/syslogd/syslogd.8  24 Sep 2016 11:32:25 -  1.50
+++ usr.sbin/syslogd/syslogd.8  28 Sep 2016 23:45:23 -
@@ -39,7 +39,7 @@
 .Sh SYNOPSIS
 .Nm syslogd
 .Bk -words
-.Op Fl 46dFhnuV
+.Op Fl 46dFhnuVZ
 .Op Fl a Ar path
 .Op Fl C Ar CAfile
 .Op Fl c Ar cert_file
@@ -169,6 +169,10 @@ attacks over the network, including atta
 .It Fl V
 Do not perform remote server certificate and hostname validation
 when sending messages.
+.It Fl Z
+Generate timestamps in ISO format.
+This includes the year and the timezone, and all logging is done
+in UTC.
 .El
 .Pp
 .Nm
Index: usr.sbin/syslogd/syslogd.c
===
RCS file: /data/mirror/openbsd/cvs/src/usr.sbin/syslogd/syslogd.c,v
retrieving revision 1.215
diff -u -p -r1.215 syslogd.c
--- usr.sbin/syslogd/syslogd.c  23 Sep 2016 15:46:39 -  1.215
+++ usr.sbin/syslogd/syslogd.c  29 Sep 2016 00:03:21 -
@@ -153,7 +153,7 @@ struct filed {
} f_mb; /* Memory buffer */
} f_un;
charf_prevline[MAXSVLINE];  /* last message logged */
-   charf_lasttime[16]; /* time of last occurrence */
+   charf_lasttime[33]; /* time of last occurrence */
charf_prevhost[HOST_NAME_MAX+1];/* host from which recd. */
int f_prevpri;  /* pri of f_prevline */
int f_prevlen;  /* length of f_prevline */
@@ -210,6 +210,7 @@ int MarkInterval = 20 * 60; /* interval 
 intMarkSeq = 0;/* mark sequence number */
 intSecureMode = 1; /* when true, speak only unix domain socks */
 intNoDNS = 0;  /* when true, will refrain from doing DNS 
lookups */
+intZuluTime = 0;   /* display date and time in UTC ISO format */
 intIncludeHostname = 0;/* include RFC 3164 style hostnames when 
forwarding */
 intFamily = PF_UNSPEC; /* protocol family, may disable IPv4 or IPv6 */
 char   *bind_host = NULL;  /* bind UDP receive socket */
@@ -358,7 +359,7 @@ main(int argc, char *argv[])
int  ch, i;
int  lockpipe[2] = { -1, -1}, pair[2], nullfd, fd;
 
-   while ((ch = getopt(argc, argv, "46a:C:c:dFf:hK:k:m:np:S:s:T:U:uV"))
+   while ((ch = getopt(argc, argv, "46a:C:c:dFf:hK:k:m:np:S:s:T:U:uVZ"))
!= -1)
switch (ch) {
case '4':   /* disable IPv6 */
@@ -438,6 +439,9 @@ main(int argc, char *argv[])
case 'V':   /* do not verify certificates */
NoVerify = 1;
break;
+   case 'Z':   /* time stamps in UTC ISO format */
+   ZuluTime = 1;
+   break;
default:
usage();
}
@@ -1471,7 +1475,7 @@ usage(void)
 {
 
(void)fprintf(stderr,
-   "usage: syslogd [-46dFhnuV] [-a path] [-C CAfile] [-c cert_file]\n"
+   "usage: syslogd [-46dFhnuVZ] [-a path] [-C CAfile] [-c cert_file]\n"
"\t[-f config_file] [-K CAfile] [-k key_file] [-m mark_interval]\n"
"\t[-p log_socket] [-S listen_address] [-s reporting_socket]\n"
"\t[-T listen_address] [-U bind_address]\n");
@@ -1583,8 +1587,9 @@ void
 logmsg(int pri, char *msg, char *from, int flags)
 {
struct filed *f;
+   struct tm *tm;
int fac, msglen, prilev, i;
-   char *timestamp;
+   char timestamp[33];
char prog[NAME_MAX+1];
 
logdebug("logmsg: pri 0%o, flags 0x%x, from %s, msg %s\n",
@@ -1593,18 +1598,80 @@ logmsg(int pri, char *msg, char *from, i
/*
 * Check to see if msg looks non-standard.
 */
+   timestamp[0] = '\0';
msglen = strlen(msg);
-   if (msglen < 16 || msg[3] != ' ' || msg[6] != ' ' ||
-   msg[9] != ':' || msg[12] != ':' || msg[15] != ' ')
-   flags |= ADDDATE;
+   if ((flags & ADDDATE) == 0) {
+   if (msglen >= 16 && msg[3] == ' ' && msg[6] == ' ' &&
+   msg[9] == ':' && msg[12] == ':' && msg[15] == ' ') {
+   /* BSD syslog TIMESTAMP, RFC 3164 */
+   

Re: cwm: remove mouse resize window

2016-09-28 Thread Okan Demirmen
On Wed 2016.09.28 at 21:33 +0100, Stuart Henderson wrote:
> On 2016/09/28 13:56, Bryan Steele wrote:
> > I typically use the mouse for window resizes, for xterms it's useful
> > even to quickly see the dimensions even without resizing, ofc there
> > are other ways to glean that info.. but if it's not too horrible, I'd
> > like if it could stay.
> 
> Exactly the same here.

Got it; thanks for the replies!

(Martin, I have another way to do the position, but thanks anyway!)



snmpd source address

2016-09-28 Thread Jeremie Courreges-Anglas

SNMP uses UDP and snmpd listens on a single address.  This means that
you can have issues with the source address of the replies sent by
snmpd.  "listen on $loopback_address":

  http://marc.info/?l=openbsd-misc=147445870822415=2

seems to be unsufficient, but I don't understand why it would fail.

The diff below should fix the source address selection for replies.
Configuring the source address for traps is a different problem and will
be implemented in a different diff.

WIP, only tested on a single box so far.  Thoughts / oks?


Index: snmpd.h
===
RCS file: /cvs/src/usr.sbin/snmpd/snmpd.h,v
retrieving revision 1.68
diff -u -p -r1.68 snmpd.h
--- snmpd.h 25 Sep 2016 14:58:00 -  1.68
+++ snmpd.h 28 Sep 2016 20:11:05 -
@@ -390,6 +390,9 @@ struct snmp_message {
socklen_tsm_slen;
char sm_host[HOST_NAME_MAX+1];
 
+   struct sockaddr_storage  sm_local_ss;
+   socklen_tsm_local_slen;
+
struct ber   sm_ber;
struct ber_element  *sm_req;
struct ber_element  *sm_resp;
@@ -766,6 +769,10 @@ struct trapcmd *
 /* util.c */
 int varbind_convert(struct agentx_pdu *, struct agentx_varbind_hdr *,
struct ber_element **, struct ber_element **);
+ssize_t sendtofrom(int, void *, size_t, int, struct sockaddr *,
+   socklen_t, struct sockaddr *, socklen_t);
+ssize_t recvfromto(int, void *, size_t, int, struct sockaddr *,
+   socklen_t *, struct sockaddr *, socklen_t *);
 voidprint_debug(const char *, ...);
 voidprint_verbose(const char *, ...);
 const char *log_in6addr(const struct in6_addr *);
Index: snmpe.c
===
RCS file: /cvs/src/usr.sbin/snmpd/snmpe.c,v
retrieving revision 1.42
diff -u -p -r1.42 snmpe.c
--- snmpe.c 16 Aug 2016 18:41:57 -  1.42
+++ snmpe.c 28 Sep 2016 20:11:05 -
@@ -120,7 +120,7 @@ int
 snmpe_bind(struct address *addr)
 {
char buf[512];
-   int  s;
+   int  val, s;
 
if ((s = snmpd_socket_af(>ss, htons(addr->port))) == -1)
return (-1);
@@ -131,6 +131,26 @@ snmpe_bind(struct address *addr)
if (fcntl(s, F_SETFL, O_NONBLOCK) == -1)
goto bad;
 
+   switch (addr->ss.ss_family) {
+   case AF_INET:
+   val = 1;
+   if (setsockopt(s, IPPROTO_IP, IP_RECVDSTADDR,
+   , sizeof(int)) == -1) {
+   log_warn("%s: failed to set IPv4 packet info",
+   __func__);
+   goto bad;
+   }
+   break;
+   case AF_INET6:
+   val = 1;
+   if (setsockopt(s, IPPROTO_IPV6, IPV6_RECVPKTINFO,
+   , sizeof(int)) == -1) {
+   log_warn("%s: failed to set IPv6 packet info",
+   __func__);
+   goto bad;
+   }
+   }
+
if (bind(s, (struct sockaddr *)>ss, addr->ss.ss_len) == -1)
goto bad;
 
@@ -460,8 +480,9 @@ snmpe_recvmsg(int fd, short sig, void *a
return;
 
msg->sm_slen = sizeof(msg->sm_ss);
-   if ((len = recvfrom(fd, msg->sm_data, sizeof(msg->sm_data), 0,
-   (struct sockaddr *)>sm_ss, >sm_slen)) < 1) {
+   if ((len = recvfromto(fd, msg->sm_data, sizeof(msg->sm_data), 0,
+   (struct sockaddr *)>sm_ss, >sm_slen,
+   (struct sockaddr *)>sm_local_ss, >sm_local_slen)) < 1) {
free(msg);
return;
}
@@ -549,8 +570,9 @@ snmpe_response(int fd, struct snmp_messa
goto done;
 
usm_finalize_digest(msg, ptr, len);
-   len = sendto(fd, ptr, len, 0, (struct sockaddr *)>sm_ss,
-   msg->sm_slen);
+   len = sendtofrom(fd, ptr, len, 0,
+   (struct sockaddr *)>sm_ss, msg->sm_slen,
+   (struct sockaddr *)>sm_local_ss, msg->sm_local_slen);
if (len != -1)
stats->snmp_outpkts++;
 
Index: util.c
===
RCS file: /cvs/src/usr.sbin/snmpd/util.c,v
retrieving revision 1.5
diff -u -p -r1.5 util.c
--- util.c  21 Nov 2015 13:06:22 -  1.5
+++ util.c  28 Sep 2016 20:11:05 -
@@ -156,6 +156,128 @@ varbind_convert(struct agentx_pdu *pdu, 
return (ret);
 }
 
+ssize_t
+sendtofrom(int s, void *buf, size_t len, int flags, struct sockaddr *to,
+socklen_t tolen, struct sockaddr *from, socklen_t fromlen)
+{
+   struct iovec iov;
+   struct msghdrmsg;
+   struct cmsghdr  *cmsg;
+   struct in6_pktinfo  *pkt6;
+   struct sockaddr_in  *in;
+   struct sockaddr_in6 *in6;
+   union {
+   struct cmsghdr  hdr;
+   char

Re: cwm: remove mouse resize window

2016-09-28 Thread Stuart Henderson
On 2016/09/28 13:56, Bryan Steele wrote:
> I typically use the mouse for window resizes, for xterms it's useful
> even to quickly see the dimensions even without resizing, ofc there
> are other ways to glean that info.. but if it's not too horrible, I'd
> like if it could stay.

Exactly the same here.



Re: cwm: remove mouse resize window

2016-09-28 Thread Martin Brandenburg
On Wed, 28 Sep 2016, Okan Demirmen wrote:

> Hi,
> 
> Curious what the reaction might be if I removed the little geometry
> window in the top-left corner for mouse/pointer based window resizes.

I don't know about anyone else, but I use this for one thing only:
making sure my terminal windows are still exactly 80 columns wide after
resizing them to be longer (or going back to 80 after making one wider
temporarily). Any other window I don't care about the exact size.

I suppose I could use stty and the keyboard resizing options if this
went away, but it seems more natural to move and resize windows with the
mouse.

> 
> We currently print the x/y dimensions only for mouse based actions; we
> don't for kbd, nor do we do anything with mouse/kbd window moves (such
> as printing the x/y coordinates, etc). So why have mouse-resize be
> different?  Thus, the below crudely removes it.
> 
> One reason to remove it is for simplicity; this is the only place we
> need to hold and carry around menuwin and a drawable. If we abused
> menuwin/drawable in other locations but the actual menu'ing subsystem,
> then ok. Alternatively, can create/destroy each time for a mouse-resize,
> but likely not worth it, maybe it should stay...

So make it display on movement too? I'm not sure how useful it is, but
it adds symmetry.

Martin

Index: mousefunc.c
===
RCS file: /cvs/xenocara/app/cwm/mousefunc.c,v
retrieving revision 1.107
diff -u -p -r1.107 mousefunc.c
--- mousefunc.c 28 Sep 2016 17:06:33 -  1.107
+++ mousefunc.c 28 Sep 2016 18:33:12 -
@@ -32,16 +32,17 @@
 
 #include "calmwm.h"
 
-static voidmousefunc_sweep_draw(struct client_ctx *);
+static voidmousefunc_sweep_draw(struct client_ctx *, int move);
 
 static void
-mousefunc_sweep_draw(struct client_ctx *cc)
+mousefunc_sweep_draw(struct client_ctx *cc, int move)
 {
struct screen_ctx   *sc = cc->sc;
char s[14]; /* fits "  x  \0" */
XGlyphInfo   extents;
 
-   (void)snprintf(s, sizeof(s), " %4d x %-4d ", cc->dim.w, cc->dim.h);
+   (void)snprintf(s, sizeof(s), " %4d x %-4d ",
+   move ? cc->geom.x : cc->dim.w, move ? cc->geom.y : cc->dim.h);
 
XftTextExtentsUtf8(X_Dpy, sc->xftfont, (const FcChar8*)s,
strlen(s), );
@@ -89,7 +90,7 @@ mousefunc_client_resize(struct client_ct
cc->geom.h = ev.xmotion.y;
client_applysizehints(cc);
client_resize(cc, 1);
-   mousefunc_sweep_draw(cc);
+   mousefunc_sweep_draw(cc, 0);
break;
case ButtonRelease:
client_resize(cc, 1);
@@ -151,9 +152,12 @@ mousefunc_client_move(struct client_ctx 
cc->geom.y + cc->geom.h + (cc->bwidth * 2),
area.y, area.y + area.h, sc->snapdist);
client_move(cc);
+   mousefunc_sweep_draw(cc, 1);
break;
case ButtonRelease:
client_move(cc);
+   XUnmapWindow(X_Dpy, sc->menuwin);
+   XReparentWindow(X_Dpy, sc->menuwin, sc->rootwin, 0, 0);
xu_ptr_ungrab();
return;
}



Re: cwm: remove mouse resize window

2016-09-28 Thread Bryan Steele
On Wed, Sep 28, 2016 at 01:34:52PM -0400, Okan Demirmen wrote:
> Hi,
> 
> Curious what the reaction might be if I removed the little geometry
> window in the top-left corner for mouse/pointer based window resizes.
> 
> We currently print the x/y dimensions only for mouse based actions; we
> don't for kbd, nor do we do anything with mouse/kbd window moves (such
> as printing the x/y coordinates, etc). So why have mouse-resize be
> different?  Thus, the below crudely removes it.
> 
> One reason to remove it is for simplicity; this is the only place we
> need to hold and carry around menuwin and a drawable. If we abused
> menuwin/drawable in other locations but the actual menu'ing subsystem,
> then ok. Alternatively, can create/destroy each time for a mouse-resize,
> but likely not worth it, maybe it should stay...
> 
> Thanks,
> Okan
> 
> Index: mousefunc.c
> ===
> RCS file: /home/open/cvs/xenocara/app/cwm/mousefunc.c,v
> retrieving revision 1.107
> diff -u -p -r1.107 mousefunc.c
> --- mousefunc.c   28 Sep 2016 17:06:33 -  1.107
> +++ mousefunc.c   28 Sep 2016 17:23:45 -
> @@ -89,7 +89,6 @@ mousefunc_client_resize(struct client_ct
>   cc->geom.h = ev.xmotion.y;
>   client_applysizehints(cc);
>   client_resize(cc, 1);
> - mousefunc_sweep_draw(cc);
>   break;
>   case ButtonRelease:
>   client_resize(cc, 1);
>

I typically use the mouse for window resizes, for xterms it's useful
even to quickly see the dimensions even without resizing, ofc there
are other ways to glean that info.. but if it's not too horrible, I'd
like if it could stay.

-Bryan.



cwm: remove mouse resize window

2016-09-28 Thread Okan Demirmen
Hi,

Curious what the reaction might be if I removed the little geometry
window in the top-left corner for mouse/pointer based window resizes.

We currently print the x/y dimensions only for mouse based actions; we
don't for kbd, nor do we do anything with mouse/kbd window moves (such
as printing the x/y coordinates, etc). So why have mouse-resize be
different?  Thus, the below crudely removes it.

One reason to remove it is for simplicity; this is the only place we
need to hold and carry around menuwin and a drawable. If we abused
menuwin/drawable in other locations but the actual menu'ing subsystem,
then ok. Alternatively, can create/destroy each time for a mouse-resize,
but likely not worth it, maybe it should stay...

Thanks,
Okan

Index: mousefunc.c
===
RCS file: /home/open/cvs/xenocara/app/cwm/mousefunc.c,v
retrieving revision 1.107
diff -u -p -r1.107 mousefunc.c
--- mousefunc.c 28 Sep 2016 17:06:33 -  1.107
+++ mousefunc.c 28 Sep 2016 17:23:45 -
@@ -89,7 +89,6 @@ mousefunc_client_resize(struct client_ct
cc->geom.h = ev.xmotion.y;
client_applysizehints(cc);
client_resize(cc, 1);
-   mousefunc_sweep_draw(cc);
break;
case ButtonRelease:
client_resize(cc, 1);



Re: send fewer router solicitations

2016-09-28 Thread Florian Obser
On Mon, Sep 26, 2016 at 10:16:04PM +0100, Stuart Henderson wrote:
> On 2016/09/26 20:14, Florian Obser wrote:
> > On Wed, Sep 21, 2016 at 01:23:25PM +0100, Stuart Henderson wrote:
> > 
> > > There's a problem with this: we lose the exponential backoff for the
> > > quick timer. Say you have v6 at home and enable autoconf on your laptop
> > > then move to a network without v6 - this results in you spamming the
> > > network with a multicast frame every second, which does not make you
> > > a good network citizen especially if that's on a wireless lan.
> > > 
> > [...]
> > > I think the current state is quite a lot worse than the previous one
> > > (even though it's better on networks that *do* have v6), so I'm wondering
> > > if it might be better to revert if it's complicated to fix here (there
> > > was a different plan for sending RS in the future anyway wasn't there?)
> > 
> > does this help?
> > If not, I guess we should back it out
> > 
> > diff --git nd6_rtr.c nd6_rtr.c
> > index a7529c9..3c23365 100644
> > --- nd6_rtr.c
> > +++ nd6_rtr.c
> > @@ -328,7 +328,8 @@ nd6_rs_output_timo(void *ignored_arg)
> > t = nd6_rs_next_pltime_timo(ifp);
> > if (t == ND6_INFINITE_LIFETIME || t <
> > ND6_RS_OUTPUT_INTERVAL) {
> > -   timeout = ND6_RS_OUTPUT_QUICK_INTERVAL;
> > +   if (t == ND6_INFINITE_LIFETIME)
> > +   timeout = ND6_RS_OUTPUT_QUICK_INTERVAL;
> > ia6 = in6ifa_ifpforlinklocal(ifp,
> > IN6_IFF_TENTATIVE);
> > if (ia6 != NULL)
> 
> Same behaviour with this. The problem is that it's just setting
> to a fixed ND6_RS_OUTPUT_QUICK_INTERVAL which isn't getting backed
> off anywhere. To fix it I think we'd at least need another global
> (if not a per-interface variable) that can be used as the "current
> quick_timeout" and back that off or reset it as necessary, but
> my attempts to do that thus far haven't been successful.
> 

then let's revert.
OK?

diff --git nd6_rtr.c nd6_rtr.c
index 93e2f4c..a9fb3f5 100644
--- nd6_rtr.c
+++ nd6_rtr.c
@@ -75,7 +75,6 @@ int rt6_deleteroute(struct rtentry *, void *, unsigned int);
 void nd6_addr_add(void *);
 
 void nd6_rs_output_timo(void *);
-u_int32_t nd6_rs_next_pltime_timo(struct ifnet *);
 void nd6_rs_output_set_timo(int);
 void nd6_rs_output(struct ifnet *, struct in6_ifaddr *);
 void nd6_rs_dev_state(void *);
@@ -284,64 +283,30 @@ nd6_rs_output_set_timo(int timeout)
timeout_add_sec(_rs_output_timer, nd6_rs_output_timeout);
 }
 
-u_int32_t
-nd6_rs_next_pltime_timo(struct ifnet *ifp)
-{
-   struct ifaddr *ifa;
-   struct in6_ifaddr *ia6;
-   u_int32_t pltime_expires = ND6_INFINITE_LIFETIME;
-
-   TAILQ_FOREACH(ifa, >if_addrlist, ifa_list) {
-   if (ifa->ifa_addr->sa_family != AF_INET6)
-   continue;
-
-   ia6 = ifatoia6(ifa);
-   if (ia6->ia6_lifetime.ia6t_pltime == ND6_INFINITE_LIFETIME ||
-   IFA6_IS_DEPRECATED(ia6) || IFA6_IS_INVALID(ia6))
-   continue;
-
-   pltime_expires = MIN(pltime_expires,
-   ia6->ia6_lifetime.ia6t_pltime);
-   }
-
-   return pltime_expires;
-}
-
 void
 nd6_rs_output_timo(void *ignored_arg)
 {
struct ifnet *ifp;
struct in6_ifaddr *ia6;
-   u_int32_t pltime_expire = ND6_INFINITE_LIFETIME, t;
-   int timeout = ND6_RS_OUTPUT_INTERVAL;
 
if (nd6_rs_timeout_count == 0)
return;
 
if (nd6_rs_output_timeout < ND6_RS_OUTPUT_INTERVAL)
/* exponential backoff if running quick timeouts */
-   timeout = nd6_rs_output_timeout * 2;
+   nd6_rs_output_timeout *= 2;
+   if (nd6_rs_output_timeout > ND6_RS_OUTPUT_INTERVAL)
+   nd6_rs_output_timeout = ND6_RS_OUTPUT_INTERVAL;
 
TAILQ_FOREACH(ifp, , if_list) {
if (ISSET(ifp->if_flags, IFF_RUNNING) &&
ISSET(ifp->if_xflags, IFXF_AUTOCONF6)) {
-   t = nd6_rs_next_pltime_timo(ifp);
-   if (t == ND6_INFINITE_LIFETIME || t <
-   ND6_RS_OUTPUT_INTERVAL) {
-   timeout = ND6_RS_OUTPUT_QUICK_INTERVAL;
-   ia6 = in6ifa_ifpforlinklocal(ifp,
-   IN6_IFF_TENTATIVE);
-   if (ia6 != NULL)
-   nd6_rs_output(ifp, ia6);
-   }
-
-   pltime_expire = MIN(pltime_expire, t);
+   ia6 = in6ifa_ifpforlinklocal(ifp, IN6_IFF_TENTATIVE);
+   if (ia6 != NULL)
+   nd6_rs_output(ifp, ia6);
}
}
-   if (pltime_expire != ND6_INFINITE_LIFETIME)
-   timeout =