|
@@ -53,6 +53,7 @@ int ifcommon_exec ( int argc, char **argv,
|
53
|
53
|
int stop_on_first_success ) {
|
54
|
54
|
struct ifcommon_options opts;
|
55
|
55
|
struct net_device *netdev;
|
|
56
|
+ int i;
|
56
|
57
|
int rc;
|
57
|
58
|
|
58
|
59
|
/* Parse options */
|
|
@@ -61,11 +62,9 @@ int ifcommon_exec ( int argc, char **argv,
|
61
|
62
|
|
62
|
63
|
if ( optind != argc ) {
|
63
|
64
|
/* Treat arguments as a list of interfaces to try */
|
64
|
|
- while ( optind != argc ) {
|
65
|
|
- if ( ( rc = parse_netdev ( argv[optind++],
|
66
|
|
- &netdev ) ) != 0 ) {
|
|
65
|
+ for ( i = optind ; i < argc ; i++ ) {
|
|
66
|
+ if ( ( rc = parse_netdev ( argv[i], &netdev ) ) != 0 )
|
67
|
67
|
continue;
|
68
|
|
- }
|
69
|
68
|
if ( ( ( rc = payload ( netdev ) ) == 0 ) &&
|
70
|
69
|
stop_on_first_success ) {
|
71
|
70
|
return 0;
|