aboutsummaryrefslogtreecommitdiff
path: root/networking/libiproute/iplink.c
diff options
context:
space:
mode:
Diffstat (limited to 'networking/libiproute/iplink.c')
-rw-r--r--networking/libiproute/iplink.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/networking/libiproute/iplink.c b/networking/libiproute/iplink.c
index dc936bdc5..8de17bfc6 100644
--- a/networking/libiproute/iplink.c
+++ b/networking/libiproute/iplink.c
@@ -174,15 +174,18 @@ static int do_set(char **argv)
174 char *newname = NULL; 174 char *newname = NULL;
175 int htype, halen; 175 int htype, halen;
176 static const char keywords[] ALIGN1 = 176 static const char keywords[] ALIGN1 =
177 "up\0""down\0""name\0""mtu\0""multicast\0""arp\0""address\0""dev\0"; 177 "up\0""down\0""name\0""mtu\0""multicast\0"
178 enum { ARG_up = 0, ARG_down, ARG_name, ARG_mtu, ARG_multicast, ARG_arp, 178 "arp\0""address\0""dev\0";
179 ARG_addr, ARG_dev }; 179 enum { ARG_up = 0, ARG_down, ARG_name, ARG_mtu, ARG_multicast,
180 ARG_arp, ARG_addr, ARG_dev };
180 static const char str_on_off[] ALIGN1 = "on\0""off\0"; 181 static const char str_on_off[] ALIGN1 = "on\0""off\0";
181 enum { PARM_on = 0, PARM_off }; 182 enum { PARM_on = 0, PARM_off };
182 smalluint key; 183 smalluint key;
183 184
184 while (*argv) { 185 while (*argv) {
185 key = index_in_strings(keywords, *argv); 186 /* substring search ensures that e.g. "addr" and "address"
187 * are both accepted */
188 key = index_in_substrings(keywords, *argv);
186 if (key == ARG_up) { 189 if (key == ARG_up) {
187 mask |= IFF_UP; 190 mask |= IFF_UP;
188 flags |= IFF_UP; 191 flags |= IFF_UP;