On Fri, Oct 27, 2023 at 11:27:11AM +0200, Claudio Jeker wrote:
> While looking for something else I noticed this error.
> 
> The holdtime is written into the buffer with ibuf_add_n16() so the htons()
> call is done in the ibuf add call. So there is no need for the htons()
> when assigning holdtime.

ok tb

> 
> -- 
> :wq Claudio
> 
> Index: session.c
> ===================================================================
> RCS file: /cvs/src/usr.sbin/bgpd/session.c,v
> retrieving revision 1.451
> diff -u -p -u -5 -r1.451 session.c
> --- session.c 19 Oct 2023 07:02:45 -0000      1.451
> +++ session.c 27 Oct 2023 09:24:20 -0000
> @@ -1570,13 +1570,13 @@ session_open(struct peer *p)
>               bgp_fsm(p, EVNT_CON_FATAL);
>               return;
>       }
>  
>       if (p->conf.holdtime)
> -             holdtime = htons(p->conf.holdtime);
> +             holdtime = p->conf.holdtime;
>       else
> -             holdtime = htons(conf->holdtime);
> +             holdtime = conf->holdtime;
>  
>       errs += ibuf_add_n8(buf->buf, 4);
>       errs += ibuf_add_n16(buf->buf, p->conf.local_short_as);
>       errs += ibuf_add_n16(buf->buf, holdtime);
>       /* is already in network byte order */
> 

Reply via email to