On Sun, Dec 22, 2019 at 10:32:12PM +0100, Denis Fondras wrote:
> On Sun, Dec 22, 2019 at 10:06:40PM +0100, Remi Locherer wrote:
> > this is similar to ospfd's hello.c rev 1.23.
> >
> > OK?
> >
> > Remi
> >
> >
> > Index: hello.c
> > ===
> > RCS file: /cvs/src/usr.sbin/ospf6d/hello.c,v
> > retrieving revision 1.19
> > diff -u -p -r1.19 hello.c
> > --- hello.c 11 Dec 2019 21:33:56 - 1.19
> > +++ hello.c 22 Dec 2019 20:46:01 -
> > @@ -173,10 +173,16 @@ recv_hello(struct iface *iface, struct i
> > nbr->dr.s_addr = hello.d_rtr;
> > nbr->bdr.s_addr = hello.bd_rtr;
> > nbr->priority = LSA_24_GETHI(ntohl(hello.opts));
> > + /* XXX neighbor address shouldn't be stored on virtual links */
> > + nbr->addr = *src;
> > + }
> > +
> > + if (memcmp(>addr, src, sizeof(struct in6_addr)) != 0) {
>
> Can you use IN6_ARE_ADDR_EQUAL() macro instead of memcmp() to be consistent
> with
> other address comparison ?
Yes, that makes sense. Thank you!
> Otherwise OK denis@
>
> > + log_warnx("%s: neighbor ID %s changed its address to %s",
> > + __func__, inet_ntoa(nbr->id), log_in6addr(src));
> > + nbr->addr = *src;
> > }
> >
> > - /* actually the neighbor address shouldn't be stored on virtual links */
> > - nbr->addr = *src;
> > nbr->options = opts;
> >
> > nbr_fsm(nbr, NBR_EVT_HELLO_RCVD);
> >
>