Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F147722607
D1814.id3712.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
997 B
Referenced Files
None
Subscribers
None
D1814.id3712.diff
View Options
Index: sbin/ifconfig/ifconfig.c
===================================================================
--- sbin/ifconfig/ifconfig.c
+++ sbin/ifconfig/ifconfig.c
@@ -1261,7 +1261,6 @@
void
ifmaybeload(const char *name)
{
-#define MOD_PREFIX_LEN 3 /* "if_" */
struct module_stat mstat;
int fileid, modid;
char ifkind[IFNAMSIZ + MOD_PREFIX_LEN], ifname[IFNAMSIZ], *dp;
@@ -1280,9 +1279,8 @@
}
/* turn interface and unit into module name */
- strcpy(ifkind, "if_");
- strlcpy(ifkind + MOD_PREFIX_LEN, ifname,
- sizeof(ifkind) - MOD_PREFIX_LEN);
+ strlcpy(ifkind, "if_", sizeof(ifkind));
+ strlcat(ifkind, ifname, sizeof(ifkind));
/* scan files in kernel */
mstat.version = sizeof(struct module_stat);
@@ -1299,8 +1297,8 @@
cp = mstat.name;
}
/* already loaded? */
- if (strncmp(ifname, cp, strlen(ifname) + 1) == 0 ||
- strncmp(ifkind, cp, strlen(ifkind) + 1) == 0)
+ if (strcmp(ifname, cp) == 0 ||
+ strcmp(ifkind, cp) == 0)
return;
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Mar 14, 5:13 AM (3 h, 46 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29653487
Default Alt Text
D1814.id3712.diff (997 B)
Attached To
Mode
D1814: Simplify string mangling in ifmaybeload().
Attached
Detach File
Event Timeline
Log In to Comment