Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107056610
D43956.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
577 B
Referenced Files
None
Subscribers
None
D43956.diff
View Options
diff --git a/usr.sbin/ndp/ndp.c b/usr.sbin/ndp/ndp.c
--- a/usr.sbin/ndp/ndp.c
+++ b/usr.sbin/ndp/ndp.c
@@ -652,6 +652,12 @@
if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0)
xo_err(1, "sysctl(PF_ROUTE estimate)");
if (needed > 0) {
+ /*
+ * Add ~2% additional space in case some records
+ * will appear between sysctl() calls.
+ * Round it up so it can fit 4 additional messages at least.
+ */
+ needed += ((needed >> 6) | (sizeof(m_rtmsg) * 4));
if ((buf = malloc(needed)) == NULL)
xo_err(1, "malloc");
if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jan 10, 11:14 AM (14 h, 3 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15742056
Default Alt Text
D43956.diff (577 B)
Attached To
Mode
D43956: Add more buffers for ndp in rtsock mode
Attached
Detach File
Event Timeline
Log In to Comment