fixeria has uploaded this change for review.

View Change

server: vty: validate rotate-localtime modulus against the new interval

apply_rotate_localtime() computed the maximum allowed modulus from
pcap_server->rotate_localtime.intv, the currently-stored (old) interval,
rather than the intv argument being applied. On first configuration the
stored interval is the default 0, so the switch hit the default case and
rejected an otherwise valid command; when changing intervals the modulus
was bounds-checked against the wrong interval. Switch on intv instead.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Change-Id: I0b367d4e255db3208b41e12adec682026b99cc18
---
M src/osmo_server_vty.c
1 file changed, 1 insertion(+), 1 deletion(-)

git pull ssh://gerrit.osmocom.org:29418/osmo-pcap refs/changes/47/42847/1
diff --git a/src/osmo_server_vty.c b/src/osmo_server_vty.c
index dfe9857..aa21411 100644
--- a/src/osmo_server_vty.c
+++ b/src/osmo_server_vty.c
@@ -289,7 +289,7 @@
static int apply_rotate_localtime(struct vty *vty, enum time_interval intv, unsigned int modulus)
{
unsigned int max_mod = 0;
- switch (pcap_server->rotate_localtime.intv) {
+ switch (intv) {
case TIME_INTERVAL_SEC:
max_mod = 60;
break;

To view, visit change 42847. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: osmo-pcap
Gerrit-Branch: master
Gerrit-Change-Id: I0b367d4e255db3208b41e12adec682026b99cc18
Gerrit-Change-Number: 42847
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy@sysmocom.de>