[BSC] Make sure we only enable hopping on BTS that support it
diff --git a/openbsc/src/bsc_vty.c b/openbsc/src/bsc_vty.c
index 46a13d3..68a0597 100644
--- a/openbsc/src/bsc_vty.c
+++ b/openbsc/src/bsc_vty.c
@@ -2015,8 +2015,15 @@
"Disable frequency hopping\n" "Enable frequency hopping\n")
{
struct gsm_bts_trx_ts *ts = vty->index;
+ int enabled = atoi(argv[0]);
- ts->hopping.enabled = atoi(argv[0]);
+ if (enabled && !gsm_bts_has_feature(ts->trx->bts, BTS_FEAT_HOPPING)) {
+ vty_out(vty, "BTS model does not support hopping%s",
+ VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+
+ ts->hopping.enabled = enabled;
return CMD_SUCCESS;
}