that is less likely to overflow the int type used. A BGP fullfeed is
now so big that this calculation overflowed and then got sign extended.
The result was for example 'route -n show' failures.
Problem identified with deraadt@
OK deraadt@ (more cleanup needed but this fix is a good start)
-/* $OpenBSD: rtsock.c,v 1.322 2021/09/14 09:15:55 mvs Exp $ */
+/* $OpenBSD: rtsock.c,v 1.323 2021/12/16 09:33:56 claudio Exp $ */
/* $NetBSD: rtsock.c,v 1.18 1996/03/29 00:32:10 cgd Exp $ */
/*
if (*given < w.w_needed)
return (ENOMEM);
} else
- *given = (11 * w.w_needed) / 10;
+ *given = w.w_needed + w.w_needed / 10;
return (error);
}