mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 12:52:44 +01:00
Merge pull request #2752 from BytesGalore/fib_shell_fix_warning
shell: fixed warning for FIB shell command handler not providing a proper return value
This commit is contained in:
commit
584e71fbe4
@ -66,7 +66,7 @@ static void _fib_usage(int info)
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
void _fib_route_handler(int argc, char **argv)
|
int _fib_route_handler(int argc, char **argv)
|
||||||
{
|
{
|
||||||
/* e.g. fibroute right now dont care about the adress/protocol family */
|
/* e.g. fibroute right now dont care about the adress/protocol family */
|
||||||
if (argc == 1) {
|
if (argc == 1) {
|
||||||
@ -86,12 +86,12 @@ void _fib_route_handler(int argc, char **argv)
|
|||||||
puts("\nunrecognized parameter1.\nPlease enter fibroute [add|del] for more information.");
|
puts("\nunrecognized parameter1.\nPlease enter fibroute [add|del] for more information.");
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (argc > 2 && !((strcmp("add", argv[1]) == 0) || (strcmp("del", argv[1]) == 0))) {
|
if (argc > 2 && !((strcmp("add", argv[1]) == 0) || (strcmp("del", argv[1]) == 0))) {
|
||||||
puts("\nunrecognized parameter2.\nPlease enter fibroute [add|del] for more information.");
|
puts("\nunrecognized parameter2.\nPlease enter fibroute [add|del] for more information.");
|
||||||
return;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* e.g. fibroute del <destination> */
|
/* e.g. fibroute del <destination> */
|
||||||
@ -106,7 +106,7 @@ void _fib_route_handler(int argc, char **argv)
|
|||||||
fib_remove_entry((uint8_t *)argv[2], (strlen(argv[2])));
|
fib_remove_entry((uint8_t *)argv[2], (strlen(argv[2])));
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* e.g. fibroute add <destination> via <next hop> dev <device> */
|
/* e.g. fibroute add <destination> via <next hop> dev <device> */
|
||||||
@ -152,9 +152,10 @@ void _fib_route_handler(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
_fib_usage(1);
|
_fib_usage(1);
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* e.g. fibroute add <destination> via <next hop> dev <device> lifetime <lifetime> */
|
/* e.g. fibroute add <destination> via <next hop> dev <device> lifetime <lifetime> */
|
||||||
@ -201,9 +202,10 @@ void _fib_route_handler(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
_fib_usage(2);
|
_fib_usage(2);
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
puts("\nunrecognized parameters.\nPlease enter fibroute [add|del] for more information.");
|
puts("\nunrecognized parameters.\nPlease enter fibroute [add|del] for more information.");
|
||||||
|
@ -160,7 +160,7 @@ extern int _netif_send(int argc, char **argv);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MODULE_FIB
|
#ifdef MODULE_FIB
|
||||||
extern void _fib_route_handler( int argc, char **argv );
|
extern int _fib_route_handler(int argc, char **argv);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const shell_command_t _shell_command_list[] = {
|
const shell_command_t _shell_command_list[] = {
|
||||||
@ -265,11 +265,7 @@ const shell_command_t _shell_command_list[] = {
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#ifdef MODULE_FIB
|
#ifdef MODULE_FIB
|
||||||
{
|
{"fibroute", "Manipulate the FIB (info: 'fibroute [add|del]')", _fib_route_handler},
|
||||||
"fibroute",
|
|
||||||
"Manipulate the FIB (info: 'fibroute [add|del]')",
|
|
||||||
_fib_route_handler
|
|
||||||
},
|
|
||||||
#endif
|
#endif
|
||||||
{NULL, NULL, NULL}
|
{NULL, NULL, NULL}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user