On Sun, Dec 08, 2019 at 11:29:43PM +0100, Remi Locherer wrote: > Hi, > > when "split-horizon simple" is used, ripd might send out messges with 0 > routes in it. This is because nentries is counted up even if the route > was not added to buf. Moving nentries++ up is fixing this. > > Below log message is an indicator for this bug: > recv_response: bad packet size, interface vether0 > > OK?
OK claudio@ but I would prefer if you also adjust send_request() just above to the same layout. That code does not have the issue with the goto free but it would be nice if the same pattern would be used in both functions. > Remi > > > Index: message.c > =================================================================== > RCS file: /cvs/src/usr.sbin/ripd/message.c,v > retrieving revision 1.12 > diff -u -p -r1.12 message.c > --- message.c 25 Oct 2014 03:23:49 -0000 1.12 > +++ message.c 8 Dec 2019 22:02:38 -0000 > @@ -292,11 +292,11 @@ send_response(struct packet_head *r_list > ibuf_add(buf, &netmask, sizeof(netmask)); > ibuf_add(buf, &nexthop, sizeof(nexthop)); > ibuf_add(buf, &metric, sizeof(metric)); > + nentries++; > free: > TAILQ_REMOVE(r_list, entry, entry); > delete_entry(entry->rr); > free(entry); > - nentries++; > } > > if (iface->auth_type == AUTH_CRYPT) > -- :wq Claudio
