X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=networking%2Fvconfig.c;h=3f12e7609c6af6d33d4912c08cdf05b68ac6280f;hb=08ea11ab0749a7977e6d47cd0fa7b3c9cc10af32;hp=4776e13248b4c8e766fb66210efaf5b0c2476e1c;hpb=fb79a2e2cfe33002398f1898c26d8e4f341db006;p=oweals%2Fbusybox.git diff --git a/networking/vconfig.c b/networking/vconfig.c index 4776e1324..3f12e7609 100644 --- a/networking/vconfig.c +++ b/networking/vconfig.c @@ -63,7 +63,7 @@ static const char *xfind_str(const char *table, const char *str) return table - 1; } -static const char cmds[] = { +static const char cmds[] ALIGN1 = { 4, ADD_VLAN_CMD, 7, 'a', 'd', 'd', 0, 3, DEL_VLAN_CMD, 7, @@ -85,7 +85,7 @@ static const char cmds[] = { 'm', 'a', 'p', 0, }; -static const char name_types[] = { +static const char name_types[] ALIGN1 = { VLAN_NAME_TYPE_PLUS_VID, 16, 'V', 'L', 'A', 'N', '_', 'P', 'L', 'U', 'S', '_', 'V', 'I', 'D', @@ -104,9 +104,9 @@ static const char name_types[] = { '_', 'N', 'O', '_', 'P', 'A', 'D', 0, }; -static const char conf_file_name[] = "/proc/net/vlan/config"; +static const char conf_file_name[] ALIGN1 = "/proc/net/vlan/config"; -int vconfig_main(int argc, char **argv); +int vconfig_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; int vconfig_main(int argc, char **argv) { struct vlan_ioctl_args ifr; @@ -133,10 +133,7 @@ int vconfig_main(int argc, char **argv) if (ifr.cmd == SET_VLAN_NAME_TYPE_CMD) { /* set_name_type */ ifr.u.name_type = *xfind_str(name_types+1, argv[1]); } else { - if (strlen(argv[1]) >= IF_NAMESIZE) { - bb_error_msg_and_die("if_name >= %d chars", IF_NAMESIZE); - } - strcpy(ifr.device1, argv[1]); + strncpy(ifr.device1, argv[1], IFNAMSIZ); p = argv[2]; /* I suppose one could try to combine some of the function calls below,