Change in osmo-bsc[master]: [hopping] vty: ensure no duplicate hopping ARFCN entries

laforge gerrit-no-reply at lists.osmocom.org
Wed Apr 7 16:27:33 UTC 2021


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/23645 )

Change subject: [hopping] vty: ensure no duplicate hopping ARFCN entries
......................................................................

[hopping] vty: ensure no duplicate hopping ARFCN entries

Change-Id: Ie27c859e3f16ada08a5cdc8ab4ac6e20a885a378
---
M src/osmo-bsc/bsc_vty.c
1 file changed, 10 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/src/osmo-bsc/bsc_vty.c b/src/osmo-bsc/bsc_vty.c
index 91eaee0..6a6411f 100644
--- a/src/osmo-bsc/bsc_vty.c
+++ b/src/osmo-bsc/bsc_vty.c
@@ -5597,6 +5597,11 @@
 		return CMD_WARNING;
 	}
 
+	if (bitvec_get_bit_pos(&ts->hopping.arfcns, arfcn) == ONE) {
+		vty_out(vty, "%% ARFCN %" PRIu16 " is already set%s", arfcn, VTY_NEWLINE);
+		return CMD_WARNING;
+	}
+
 	bitvec_set_bit_pos(&ts->hopping.arfcns, arfcn, 1);
 
 	return CMD_SUCCESS;
@@ -5618,6 +5623,11 @@
 		return CMD_WARNING;
 	}
 
+	if (bitvec_get_bit_pos(&ts->hopping.arfcns, arfcn) != ONE) {
+		vty_out(vty, "%% ARFCN %" PRIu16 " is not set%s", arfcn, VTY_NEWLINE);
+		return CMD_WARNING;
+	}
+
 	bitvec_set_bit_pos(&ts->hopping.arfcns, arfcn, 0);
 
 	return CMD_SUCCESS;

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/23645
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ie27c859e3f16ada08a5cdc8ab4ac6e20a885a378
Gerrit-Change-Number: 23645
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210407/f8e0b9f7/attachment.htm>


More information about the gerrit-log mailing list