mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 12:52:44 +01:00
shell: ifconfig: make 6lo flag read-only
This commit is contained in:
parent
df9457bd02
commit
ef9a9b0e4f
@ -97,7 +97,7 @@ static void _mtu_usage(char *cmd_name)
|
||||
|
||||
static void _flag_usage(char *cmd_name)
|
||||
{
|
||||
printf("usage: %s <if_id> [-]{promisc|autoack|csma|autocca|preload|6lo|iphc}\n", cmd_name);
|
||||
printf("usage: %s <if_id> [-]{promisc|autoack|csma|autocca|preload|iphc}\n", cmd_name);
|
||||
}
|
||||
|
||||
static void _add_usage(char *cmd_name)
|
||||
@ -589,37 +589,6 @@ static int _netif_flag(char *cmd, kernel_pid_t dev, char *flag)
|
||||
else if (strcmp(flag, "autocca") == 0) {
|
||||
return _netif_set_flag(dev, NETOPT_AUTOCCA, set);
|
||||
}
|
||||
else if (strcmp(flag, "6lo") == 0) {
|
||||
#ifdef MODULE_GNRC_IPV6_NETIF
|
||||
gnrc_ipv6_netif_t *entry = gnrc_ipv6_netif_get(dev);
|
||||
|
||||
if (entry == NULL) {
|
||||
puts("error: unable to (un)set 6LoWPAN support");
|
||||
return 1;
|
||||
}
|
||||
|
||||
mutex_lock(&entry->mutex);
|
||||
|
||||
if (set) {
|
||||
entry->flags |= GNRC_IPV6_NETIF_FLAGS_SIXLOWPAN;
|
||||
printf("success: set 6LoWPAN support on interface %" PRIkernel_pid
|
||||
"\n", dev);
|
||||
}
|
||||
else {
|
||||
entry->flags &= ~GNRC_IPV6_NETIF_FLAGS_SIXLOWPAN;
|
||||
printf("success: unset 6LoWPAN support on interface %" PRIkernel_pid
|
||||
"\n", dev);
|
||||
}
|
||||
|
||||
mutex_unlock(&entry->mutex);
|
||||
|
||||
return 0;
|
||||
#else
|
||||
puts("error: unable to (un)set 6LoWPAN support");
|
||||
|
||||
return 1;
|
||||
#endif
|
||||
}
|
||||
else if (strcmp(flag, "iphc") == 0) {
|
||||
#if defined(MODULE_GNRC_SIXLOWPAN_NETIF) && defined(MODULE_GNRC_SIXLOWPAN_IPHC)
|
||||
gnrc_sixlowpan_netif_t *entry = gnrc_sixlowpan_netif_get(dev);
|
||||
|
Loading…
Reference in New Issue
Block a user