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

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

fixeria gerrit-no-reply at lists.osmocom.org
Tue Apr 6 03:01:49 UTC 2021


fixeria has uploaded this change for review. ( 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(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/45/23645/1

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-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210406/0700b9ca/attachment.htm>


More information about the gerrit-log mailing list