Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107188627
D23840.id83509.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D23840.id83509.diff
View Options
Index: sys/netgraph/ng_base.c
===================================================================
--- sys/netgraph/ng_base.c
+++ sys/netgraph/ng_base.c
@@ -2771,7 +2771,7 @@
case NGM_BINARY2ASCII:
{
- int bufSize = 20 * 1024; /* XXX hard coded constant */
+ int bufSize = 1024;
const struct ng_parse_type *argstype;
const struct ng_cmdlist *c;
struct ng_mesg *binary, *ascii;
@@ -2785,7 +2785,7 @@
error = EINVAL;
break;
}
-
+retry_b2a:
/* Get a response message with lots of room */
NG_MKRESPONSE(resp, msg, sizeof(*ascii) + bufSize, M_NOWAIT);
if (resp == NULL) {
@@ -2827,9 +2827,13 @@
if (argstype == NULL) {
*ascii->data = '\0';
} else {
- if ((error = ng_unparse(argstype,
- (u_char *)binary->data,
- ascii->data, bufSize)) != 0) {
+ error = ng_unparse(argstype, (u_char *)binary->data,
+ ascii->data, bufSize);
+ if (error == ERANGE) {
+ NG_FREE_MSG(resp);
+ bufSize *= 2;
+ goto retry_b2a;
+ } else if (error) {
NG_FREE_MSG(resp);
break;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Jan 12, 9:54 AM (7 h, 57 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15767267
Default Alt Text
D23840.id83509.diff (1 KB)
Attached To
Mode
D23840: netgraph/ng_base: Allow larger BINARY2ASCII conversions
Attached
Detach File
Event Timeline
Log In to Comment