Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F105281461
D37566.id113674.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
D37566.id113674.diff
View Options
diff --git a/sys/net/if.c b/sys/net/if.c
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -2610,8 +2610,7 @@
else if (ifr_buffer_get_length(ifr) == 0)
descrbuf = NULL;
else {
- descrbuf = malloc(ifr_buffer_get_length(ifr),
- M_IFDESCR, M_WAITOK | M_ZERO);
+ descrbuf = if_allocdescr(ifr_buffer_get_length(ifr), true);
error = copyin(ifr_buffer_get_buffer(ifr), descrbuf,
ifr_buffer_get_length(ifr) - 1);
if (error) {
@@ -4273,6 +4272,12 @@
if_freedescr(odescrbuf);
}
+char *
+if_allocdescr(size_t sz, bool waitok)
+{
+ return (malloc(sz, M_IFDESCR, M_ZERO | (waitok ? M_ZERO : 0)));
+}
+
void
if_freedescr(char *descrbuf)
{
diff --git a/sys/net/if_var.h b/sys/net/if_var.h
--- a/sys/net/if_var.h
+++ b/sys/net/if_var.h
@@ -740,6 +740,7 @@
int if_getcapenable(if_t ifp);
const char *if_getdname(if_t ifp);
void if_setdescr(if_t ifp, char *descrbuf);
+char *if_allocdescr(size_t sz, bool waitok);
void if_freedescr(char *descrbuf);
int if_setdev(if_t ifp, void *dev);
int if_setdrvflagbits(if_t ifp, int if_setflags, int clear_flags);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Dec 15, 10:38 AM (14 h, 58 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15408540
Default Alt Text
D37566.id113674.diff (1 KB)
Attached To
Mode
D37566: net: add if_allocdescr() to permit updating interface description from the kernel
Attached
Detach File
Event Timeline
Log In to Comment