GPRS: don't allow VTY configuration of GPRS parameters if GPRS inactive
diff --git a/openbsc/src/vty_interface.c b/openbsc/src/vty_interface.c
index 72a5eae..4d5a782 100644
--- a/openbsc/src/vty_interface.c
+++ b/openbsc/src/vty_interface.c
@@ -1633,6 +1633,11 @@
 {
 	struct gsm_bts *bts = vty->index;
 
+	if (!bts->gprs.enabled) {
+		vty_out(vty, "%% GPRS not enabled on this BTS%s", VTY_NEWLINE);
+		return CMD_WARNING;
+	}
+
 	bts->gprs.cell.bvci = atoi(argv[0]);
 
 	return CMD_SUCCESS;
@@ -1645,6 +1650,11 @@
 	struct gsm_bts *bts = vty->index;
 	int idx = atoi(argv[0]);
 
+	if (!bts->gprs.enabled) {
+		vty_out(vty, "%% GPRS not enabled on this BTS%s", VTY_NEWLINE);
+		return CMD_WARNING;
+	}
+
 	bts->gprs.nsvc[idx].nsvci = atoi(argv[1]);
 
 	return CMD_SUCCESS;
@@ -1657,6 +1667,11 @@
 	struct gsm_bts *bts = vty->index;
 	int idx = atoi(argv[0]);
 
+	if (!bts->gprs.enabled) {
+		vty_out(vty, "%% GPRS not enabled on this BTS%s", VTY_NEWLINE);
+		return CMD_WARNING;
+	}
+
 	bts->gprs.nsvc[idx].local_port = atoi(argv[1]);
 
 	return CMD_SUCCESS;
@@ -1669,6 +1684,11 @@
 	struct gsm_bts *bts = vty->index;
 	int idx = atoi(argv[0]);
 
+	if (!bts->gprs.enabled) {
+		vty_out(vty, "%% GPRS not enabled on this BTS%s", VTY_NEWLINE);
+		return CMD_WARNING;
+	}
+
 	bts->gprs.nsvc[idx].remote_port = atoi(argv[1]);
 
 	return CMD_SUCCESS;
@@ -1682,6 +1702,11 @@
 	int idx = atoi(argv[0]);
 	struct in_addr ia;
 
+	if (!bts->gprs.enabled) {
+		vty_out(vty, "%% GPRS not enabled on this BTS%s", VTY_NEWLINE);
+		return CMD_WARNING;
+	}
+
 	inet_aton(argv[1], &ia);
 	bts->gprs.nsvc[idx].remote_ip = ntohl(ia.s_addr);
 
@@ -1694,6 +1719,11 @@
 {
 	struct gsm_bts *bts = vty->index;
 
+	if (!bts->gprs.enabled) {
+		vty_out(vty, "%% GPRS not enabled on this BTS%s", VTY_NEWLINE);
+		return CMD_WARNING;
+	}
+
 	bts->gprs.rac = atoi(argv[0]);
 
 	return CMD_SUCCESS;