bgpd reset idle hold values on neighbor clear

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

bgpd reset idle hold values on neighbor clear

Claudio Jeker
I just changed the way IdleHold time is reset to the default values.
Another place I think it makes sense to reset these backoff values is
when an admin issues a bgpctl nei 192.0.2.2 clear or up.

This should help bringing sessions up between systems after instabilities
(or in my case when testing too much and therefor reseting the session
over and over again).

OK?
--
:wq Claudio

Index: control.c
===================================================================
RCS file: /cvs/src/usr.sbin/bgpd/control.c,v
retrieving revision 1.98
diff -u -p -r1.98 control.c
--- control.c 8 Aug 2019 20:06:29 -0000 1.98
+++ control.c 12 Aug 2019 14:11:12 -0000
@@ -376,6 +376,9 @@ control_dispatch_msg(struct pollfd *pfd,
  bgp_fsm(p, EVNT_START);
  p->conf.down = 0;
  p->conf.shutcomm[0] = '\0';
+ p->IdleHoldTime =
+    INTERVAL_IDLE_HOLD_INITIAL;
+ p->errcnt = 0;
  control_result(c, CTL_RES_OK);
  break;
  case IMSG_CTL_NEIGHBOR_DOWN:
@@ -390,6 +393,9 @@ control_dispatch_msg(struct pollfd *pfd,
  strlcpy(p->conf.shutcomm,
     neighbor->shutcomm,
     sizeof(neighbor->shutcomm));
+ p->IdleHoldTime =
+    INTERVAL_IDLE_HOLD_INITIAL;
+ p->errcnt = 0;
  if (!p->conf.down) {
  session_stop(p,
     ERR_CEASE_ADMIN_RESET);

Reply | Threaded
Open this post in threaded view
|

Re: bgpd reset idle hold values on neighbor clear

Theo de Raadt-2
Gee, I just sent you a private email about exactly that :)

I fully support that.  Otherwise the workflow includes a piece of
"did it really come back up?   Oh I better check.  Oh it didn't,
I have to down it then up it"

And then, between the check and forcing it down, it may in fact
have come up!

Claudio Jeker <[hidden email]> wrote:

> I just changed the way IdleHold time is reset to the default values.
> Another place I think it makes sense to reset these backoff values is
> when an admin issues a bgpctl nei 192.0.2.2 clear or up.
>
> This should help bringing sessions up between systems after instabilities
> (or in my case when testing too much and therefor reseting the session
> over and over again).
>
> OK?
> --
> :wq Claudio
>
> Index: control.c
> ===================================================================
> RCS file: /cvs/src/usr.sbin/bgpd/control.c,v
> retrieving revision 1.98
> diff -u -p -r1.98 control.c
> --- control.c 8 Aug 2019 20:06:29 -0000 1.98
> +++ control.c 12 Aug 2019 14:11:12 -0000
> @@ -376,6 +376,9 @@ control_dispatch_msg(struct pollfd *pfd,
>   bgp_fsm(p, EVNT_START);
>   p->conf.down = 0;
>   p->conf.shutcomm[0] = '\0';
> + p->IdleHoldTime =
> +    INTERVAL_IDLE_HOLD_INITIAL;
> + p->errcnt = 0;
>   control_result(c, CTL_RES_OK);
>   break;
>   case IMSG_CTL_NEIGHBOR_DOWN:
> @@ -390,6 +393,9 @@ control_dispatch_msg(struct pollfd *pfd,
>   strlcpy(p->conf.shutcomm,
>      neighbor->shutcomm,
>      sizeof(neighbor->shutcomm));
> + p->IdleHoldTime =
> +    INTERVAL_IDLE_HOLD_INITIAL;
> + p->errcnt = 0;
>   if (!p->conf.down) {
>   session_stop(p,
>      ERR_CEASE_ADMIN_RESET);
>

Reply | Threaded
Open this post in threaded view
|

Re: bgpd reset idle hold values on neighbor clear

Stuart Henderson
In reply to this post by Claudio Jeker
On 2019/08/12 16:18, Claudio Jeker wrote:
> I just changed the way IdleHold time is reset to the default values.
> Another place I think it makes sense to reset these backoff values is
> when an admin issues a bgpctl nei 192.0.2.2 clear or up.
>
> This should help bringing sessions up between systems after instabilities
> (or in my case when testing too much and therefor reseting the session
> over and over again).
>
> OK?

Been there done that - yes please! OK.

> --
> :wq Claudio
>
> Index: control.c
> ===================================================================
> RCS file: /cvs/src/usr.sbin/bgpd/control.c,v
> retrieving revision 1.98
> diff -u -p -r1.98 control.c
> --- control.c 8 Aug 2019 20:06:29 -0000 1.98
> +++ control.c 12 Aug 2019 14:11:12 -0000
> @@ -376,6 +376,9 @@ control_dispatch_msg(struct pollfd *pfd,
>   bgp_fsm(p, EVNT_START);
>   p->conf.down = 0;
>   p->conf.shutcomm[0] = '\0';
> + p->IdleHoldTime =
> +    INTERVAL_IDLE_HOLD_INITIAL;
> + p->errcnt = 0;
>   control_result(c, CTL_RES_OK);
>   break;
>   case IMSG_CTL_NEIGHBOR_DOWN:
> @@ -390,6 +393,9 @@ control_dispatch_msg(struct pollfd *pfd,
>   strlcpy(p->conf.shutcomm,
>      neighbor->shutcomm,
>      sizeof(neighbor->shutcomm));
> + p->IdleHoldTime =
> +    INTERVAL_IDLE_HOLD_INITIAL;
> + p->errcnt = 0;
>   if (!p->conf.down) {
>   session_stop(p,
>      ERR_CEASE_ADMIN_RESET);
>

Reply | Threaded
Open this post in threaded view
|

Re: bgpd reset idle hold values on neighbor clear

Tom Smyth
+1 from a lowly user :)

On Mon, 12 Aug 2019 at 15:43, Stuart Henderson <[hidden email]> wrote:

>
> On 2019/08/12 16:18, Claudio Jeker wrote:
> > I just changed the way IdleHold time is reset to the default values.
> > Another place I think it makes sense to reset these backoff values is
> > when an admin issues a bgpctl nei 192.0.2.2 clear or up.
> >
> > This should help bringing sessions up between systems after instabilities
> > (or in my case when testing too much and therefor reseting the session
> > over and over again).
> >
> > OK?
>
> Been there done that - yes please! OK.
>
> > --
> > :wq Claudio
> >
> > Index: control.c
> > ===================================================================
> > RCS file: /cvs/src/usr.sbin/bgpd/control.c,v
> > retrieving revision 1.98
> > diff -u -p -r1.98 control.c
> > --- control.c 8 Aug 2019 20:06:29 -0000       1.98
> > +++ control.c 12 Aug 2019 14:11:12 -0000
> > @@ -376,6 +376,9 @@ control_dispatch_msg(struct pollfd *pfd,
> >                                       bgp_fsm(p, EVNT_START);
> >                                       p->conf.down = 0;
> >                                       p->conf.shutcomm[0] = '\0';
> > +                                     p->IdleHoldTime =
> > +                                         INTERVAL_IDLE_HOLD_INITIAL;
> > +                                     p->errcnt = 0;
> >                                       control_result(c, CTL_RES_OK);
> >                                       break;
> >                               case IMSG_CTL_NEIGHBOR_DOWN:
> > @@ -390,6 +393,9 @@ control_dispatch_msg(struct pollfd *pfd,
> >                                       strlcpy(p->conf.shutcomm,
> >                                           neighbor->shutcomm,
> >                                           sizeof(neighbor->shutcomm));
> > +                                     p->IdleHoldTime =
> > +                                         INTERVAL_IDLE_HOLD_INITIAL;
> > +                                     p->errcnt = 0;
> >                                       if (!p->conf.down) {
> >                                               session_stop(p,
> >                                                   ERR_CEASE_ADMIN_RESET);
> >
>


--
Kindest regards,
Tom Smyth.