lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
gerrit-log@lists.osmocom.org

May 2023

  • 1 participants
  • 2583 discussions
[S] Change in libosmocore[master]: Fix 'Fix parsing of TLV_TYPE_SINGLE_TV'
by daniel 02 May '23

02 May '23
Attention is currently required from: neels, pespin. daniel has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/32549 ) Change subject: Fix 'Fix parsing of TLV_TYPE_SINGLE_TV' ...................................................................... Patch Set 2: Code-Review+1 (1 comment) File tests/tlv/tlv_test.c: https://gerrit.osmocom.org/c/libosmocore/+/32549/comment/3e38b93c_6f83d794 PS2, Line 478: OSMO_ASSERT((*val & 0x0f) == exp_val); I think it makes sense to document somewhere (e.g. in the TLV_TYPE_SINGLE_TV variant) that masking the value is needed. -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/32549 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Id619459c17976b77cd2c7e4179123bb06807285c Gerrit-Change-Number: 32549 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-CC: laforge <laforge(a)osmocom.org> Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Tue, 02 May 2023 12:52:57 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in libosmo-gprs[master]: llc: Log received wrong FCS field
by pespin 02 May '23

02 May '23
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-gprs/+/32568 ) Change subject: llc: Log received wrong FCS field ...................................................................... llc: Log received wrong FCS field Change-Id: I448680ee82fca226df4d33650537167b2e496e24 --- M src/llc/llc.c 1 file changed, 11 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-gprs refs/changes/68/32568/1 diff --git a/src/llc/llc.c b/src/llc/llc.c index 3831f8a..ef52ec3 100644 --- a/src/llc/llc.c +++ b/src/llc/llc.c @@ -754,7 +754,8 @@ if (~pdu_dec->flags & OSMO_GPRS_LLC_PDU_F_PROT_MODE) crc_length = OSMO_MIN(crc_length, UI_HDR_LEN + N202); if (pdu_dec->fcs != gprs_llc_fcs(ll_pdu, crc_length)) { - LOGLLE(lle, LOGL_INFO, "Dropping frame with invalid FCS\n"); + LOGLLE(lle, LOGL_NOTICE, "Dropping frame with invalid FCS 0x%06x vs exp 0x%06x\n", + pdu_dec->fcs, gprs_llc_fcs(ll_pdu, crc_length)); return -EIO; } -- To view, visit https://gerrit.osmocom.org/c/libosmo-gprs/+/32568 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-gprs Gerrit-Branch: master Gerrit-Change-Id: I448680ee82fca226df4d33650537167b2e496e24 Gerrit-Change-Number: 32568 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in osmocom-bb[master]: layer23: modem: Delay GPRS attach at startup until modem is ready
by pespin 02 May '23

02 May '23
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmocom-bb/+/32567 ) Change subject: layer23: modem: Delay GPRS attach at startup until modem is ready ...................................................................... layer23: modem: Delay GPRS attach at startup until modem is ready Wait until SIM is ready, network system information ws obtained and it announced the MS is able to use GPRS against it. Change-Id: I5029d9e8a47b8544b3b803c4db6352269bac3c0e --- M src/host/layer23/include/osmocom/bb/modem/modem.h M src/host/layer23/src/modem/app_modem.c M src/host/layer23/src/modem/gmm.c M src/host/layer23/src/modem/grr.c 4 files changed, 82 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/67/32567/1 diff --git a/src/host/layer23/include/osmocom/bb/modem/modem.h b/src/host/layer23/include/osmocom/bb/modem/modem.h index 3945804..29d2571 100644 --- a/src/host/layer23/include/osmocom/bb/modem/modem.h +++ b/src/host/layer23/include/osmocom/bb/modem/modem.h @@ -3,4 +3,16 @@ #include <stdbool.h> int modem_start(void); +int modem_gprs_attach_if_needed(struct osmocom_ms *ms); +enum modem_state { + MODEM_ST_IDLE, + MODEM_ST_ATTACHING, + MODEM_ST_ATTACHED +}; + +struct modem_app { + struct osmocom_ms *ms; + enum modem_state modem_state; +}; +extern struct modem_app app_data; diff --git a/src/host/layer23/src/modem/app_modem.c b/src/host/layer23/src/modem/app_modem.c index 07211d0..b657d8c 100644 --- a/src/host/layer23/src/modem/app_modem.c +++ b/src/host/layer23/src/modem/app_modem.c @@ -54,14 +54,58 @@ #include <osmocom/bb/modem/sm.h> #include <osmocom/bb/modem/vty.h> #include <osmocom/bb/modem/grr.h> +#include <osmocom/bb/modem/modem.h> #include <l1ctl_proto.h> #include "config.h" -static struct { - struct osmocom_ms *ms; -} app_data; +struct modem_app app_data; + +static bool modem_can_gprs_attach(const struct osmocom_ms *ms) +{ + const struct gsm_subscriber *subscr = &ms->subscr; + const struct gsm322_cellsel *cs = &ms->cellsel; + const struct gsm48_sysinfo *si = &cs->sel_si; + + if (!subscr->sim_valid) + goto ret_false; + + if (!si->si1 || !si->si3 || !si->si4 || !si->si13) + goto ret_false; + + if (!si->gprs.supported) + goto ret_false; + + return true; + +ret_false: + LOGP(DRLCMAC, LOGL_INFO, "Delaying GPRS attach, waiting for:%s%s%s%s%s%s\n", + subscr->sim_valid ? "" : " imsi", + si->si1 ? "" : " si1", + si->si3 ? "" : " si3", + si->si4 ? "" : " si4", + si->si13 ? "" : " si13", + si->gprs.supported ? "" : " GprsIndicator"); + return false; +} + +int modem_gprs_attach_if_needed(struct osmocom_ms *ms) +{ + int rc; + + if (app_data.modem_state != MODEM_ST_IDLE) + return 0; + + if (!modem_can_gprs_attach(ms)) + return 0; + + app_data.modem_state = MODEM_ST_ATTACHING; + rc = modem_gmm_gmmreg_attach_req(ms); + if (rc < 0) + app_data.modem_state = MODEM_ST_IDLE; + return rc; +} /* Local network-originated IP packet, needs to be sent via SNDCP/LLC (GPRS) towards GSM network */ static int modem_tun_data_ind_cb(struct osmo_tundev *tun, struct msgb *msg) @@ -126,7 +170,7 @@ switch (signal) { case S_L23_SUBSCR_SIM_ATTACHED: ms = signal_data; - modem_gmm_gmmreg_attach_req(ms); + modem_gprs_attach_if_needed(ms); break; case S_L23_SUBSCR_SIM_DETACHED: ms = signal_data; diff --git a/src/host/layer23/src/modem/gmm.c b/src/host/layer23/src/modem/gmm.c index 129c4ba..62c6d5e 100644 --- a/src/host/layer23/src/modem/gmm.c +++ b/src/host/layer23/src/modem/gmm.c @@ -44,6 +44,7 @@ #include <osmocom/bb/common/apn.h> #include <osmocom/bb/common/ms.h> #include <osmocom/bb/modem/gmm.h> +#include <osmocom/bb/modem/modem.h> static int modem_gmm_prim_up_cb(struct osmo_gprs_gmm_prim *gmm_prim, void *user_data) { @@ -59,10 +60,13 @@ LOGP(DGMM, LOGL_NOTICE, "%s(): Rx %s: Attach success P-TMSI=0x%08x\n", __func__, pdu_name, gmm_prim->gmmreg.attach_cnf.acc.allocated_ptmsi); ms->subscr.ptmsi = gmm_prim->gmmreg.attach_cnf.acc.allocated_ptmsi; + app_data.modem_state = MODEM_ST_ATTACHED; } else { uint8_t cause = gmm_prim->gmmreg.attach_cnf.rej.cause; LOGP(DGMM, LOGL_ERROR, "%s(): Rx %s: Attach rejected, cause=%u (%s)\n", __func__, pdu_name, cause, get_value_string(gsm48_gmm_cause_names, cause)); + app_data.modem_state = MODEM_ST_IDLE; + modem_gprs_attach_if_needed(ms); } break; case OSMO_PRIM(OSMO_GPRS_GMM_GMMREG_SIM_AUTH, PRIM_OP_INDICATION): diff --git a/src/host/layer23/src/modem/grr.c b/src/host/layer23/src/modem/grr.c index b22832e..b6abae5 100644 --- a/src/host/layer23/src/modem/grr.c +++ b/src/host/layer23/src/modem/grr.c @@ -40,6 +40,7 @@ #include <osmocom/bb/common/sysinfo.h> #include <osmocom/bb/common/l1ctl.h> #include <osmocom/bb/common/ms.h> +#include <osmocom/bb/modem/modem.h> #include <osmocom/bb/mobile/gsm322.h> #include <osmocom/bb/mobile/gsm48_rr.h> @@ -115,6 +116,7 @@ return rc; } + modem_gprs_attach_if_needed(ms); return 0; } @@ -150,6 +152,7 @@ LOGP(DRR, LOGL_NOTICE, "Found GPRS Indicator (RA Colour %u, SI13 on BCCH %s)\n", cs->sel_si.gprs.ra_colour, cs->sel_si.gprs.si13_pos ? "Ext" : "Norm"); + modem_gprs_attach_if_needed(ms); return 0; } @@ -177,6 +180,7 @@ LOGP(DRR, LOGL_NOTICE, "Found GPRS Indicator (RA Colour %u, SI13 on BCCH %s)\n", cs->sel_si.gprs.ra_colour, cs->sel_si.gprs.si13_pos ? "Ext" : "Norm"); + modem_gprs_attach_if_needed(ms); return 0; } @@ -198,6 +202,8 @@ /* Forward SI13 to RLC/MAC layer */ rlcmac_prim = osmo_gprs_rlcmac_prim_alloc_l1ctl_ccch_data_ind(0 /* TODO: fn */, msgb_l3(msg)); rc = osmo_gprs_rlcmac_prim_lower_up(rlcmac_prim); + + modem_gprs_attach_if_needed(ms); return rc; } -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/32567 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: I5029d9e8a47b8544b3b803c4db6352269bac3c0e Gerrit-Change-Number: 32567 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in libosmocore[master]: tlv: Show bug in decoded tlv_parsed for type TLV_TYPE_SINGLE_TV
by pespin 02 May '23

02 May '23
Attention is currently required from: fixeria, daniel. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/32566 ) Change subject: tlv: Show bug in decoded tlv_parsed for type TLV_TYPE_SINGLE_TV ...................................................................... Patch Set 1: Code-Review+2 (1 comment) File tests/tlv/tlv_test.c: https://gerrit.osmocom.org/c/libosmocore/+/32566/comment/db8e3b48_02e991f0 PS1, Line 473: //FIXME! > I find the fixme here (and below) confusing, better would be a comment explaining that this tests fo […] I think it's fine not spending time here since it will be merged together with the follow up commit. I think having it split into 2 tests has other benefits than "test must always pass". For instance somebody can easily switch versions and test whatever behavior before and after the patch. -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/32566 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Ia17c84059a413f80c2bcf194034ebac586ecf7e1 Gerrit-Change-Number: 32566 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: daniel <dwillmann(a)sysmocom.de> Gerrit-Comment-Date: Tue, 02 May 2023 11:46:59 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Comment-In-Reply-To: daniel <dwillmann(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
[S] Change in libosmocore[master]: tlv: Show bug in decoded tlv_parsed for type TLV_TYPE_SINGLE_TV
by daniel 02 May '23

02 May '23
Attention is currently required from: pespin, fixeria. daniel has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/32566 ) Change subject: tlv: Show bug in decoded tlv_parsed for type TLV_TYPE_SINGLE_TV ...................................................................... Patch Set 1: Code-Review+1 (2 comments) Patchset: PS1: See my comment about the comment, but feel free to merge as-is. File tests/tlv/tlv_test.c: https://gerrit.osmocom.org/c/libosmocore/+/32566/comment/fa25866c_eaee4048 PS1, Line 473: //FIXME! I find the fixme here (and below) confusing, better would be a comment explaining that this tests for the current behaviour and will be changed once the parser is fixed. I general I dislike our rule that "tests must always pass", but that is a different discussion. -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/32566 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Ia17c84059a413f80c2bcf194034ebac586ecf7e1 Gerrit-Change-Number: 32566 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Tue, 02 May 2023 11:25:19 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmocom-bb[master]: trxcon: do not call l1sched_prim_dequeue() at ul_bid != 0
by pespin 02 May '23

02 May '23
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/32058 ) Change subject: trxcon: do not call l1sched_prim_dequeue() at ul_bid != 0 ...................................................................... trxcon: do not call l1sched_prim_dequeue() at ul_bid != 0 It may happen that the Tx queue is empty at TDMA Fn corresponding to ul_bid == 0, and then shortly after something appears at ul_bid != 0. The lchan Tx handlers call the encoding functions from libosmocoding only at bid == 0, so dequeueing at ul_bid != 0 makes no sense. Change-Id: Ic0bbe2ab6c0ccd96c1f8af8aa17ac88adf7f88ed Related: OS#5500 --- M src/host/trxcon/src/sched_trx.c 1 file changed, 26 insertions(+), 6 deletions(-) Approvals: Jenkins Builder: Verified pespin: Looks good to me, approved diff --git a/src/host/trxcon/src/sched_trx.c b/src/host/trxcon/src/sched_trx.c index acf060e..bcd24f0 100644 --- a/src/host/trxcon/src/sched_trx.c +++ b/src/host/trxcon/src/sched_trx.c @@ -122,14 +122,18 @@ return; /* If no primitive is being processed, try obtaining one from Tx queue */ - if (lchan->prim == NULL) - lchan->prim = l1sched_lchan_prim_dequeue(lchan, br->fn); if (lchan->prim == NULL) { - /* If CBTX (Continuous Burst Transmission) is required */ - if (l1sched_lchan_desc[chan].flags & L1SCHED_CH_FLAG_CBTX) - l1sched_lchan_prim_assign_dummy(lchan); - if (lchan->prim == NULL) + /* Align to the first burst of a block */ + if (frame->ul_bid != 0) return; + lchan->prim = l1sched_lchan_prim_dequeue(lchan, br->fn); + if (lchan->prim == NULL) { + /* If CBTX (Continuous Burst Transmission) is required */ + if (l1sched_lchan_desc[chan].flags & L1SCHED_CH_FLAG_CBTX) + l1sched_lchan_prim_assign_dummy(lchan); + if (lchan->prim == NULL) + return; + } } /* TODO: report TX buffers health to the higher layers */ -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/32058 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: Ic0bbe2ab6c0ccd96c1f8af8aa17ac88adf7f88ed Gerrit-Change-Number: 32058 Gerrit-PatchSet: 2 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[S] Change in osmocom-bb[master]: trxcon: do not call l1sched_prim_dequeue() at ul_bid != 0
by pespin 02 May '23

02 May '23
Attention is currently required from: fixeria. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/32058 ) Change subject: trxcon: do not call l1sched_prim_dequeue() at ul_bid != 0 ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/32058 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: Ic0bbe2ab6c0ccd96c1f8af8aa17ac88adf7f88ed Gerrit-Change-Number: 32058 Gerrit-PatchSet: 2 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Tue, 02 May 2023 10:24:33 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in libosmocore[master]: Fix 'Fix parsing of TLV_TYPE_SINGLE_TV'
by osmith 02 May '23

02 May '23
Attention is currently required from: neels, pespin. osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/32549 ) Change subject: Fix 'Fix parsing of TLV_TYPE_SINGLE_TV' ...................................................................... Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/32549 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Id619459c17976b77cd2c7e4179123bb06807285c Gerrit-Change-Number: 32549 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-CC: laforge <laforge(a)osmocom.org> Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Tue, 02 May 2023 10:20:55 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in libosmocore[master]: tlv: Show bug in decoded tlv_parsed for type TLV_TYPE_SINGLE_TV
by osmith 02 May '23

02 May '23
Attention is currently required from: pespin, fixeria. osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/32566 ) Change subject: tlv: Show bug in decoded tlv_parsed for type TLV_TYPE_SINGLE_TV ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/32566 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Ia17c84059a413f80c2bcf194034ebac586ecf7e1 Gerrit-Change-Number: 32566 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Tue, 02 May 2023 10:18:48 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in libosmocore[master]: tlv: Show bug in decoded tlv_parsed for type TLV_TYPE_SINGLE_TV
by pespin 02 May '23

02 May '23
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/32566 ) Change subject: tlv: Show bug in decoded tlv_parsed for type TLV_TYPE_SINGLE_TV ...................................................................... tlv: Show bug in decoded tlv_parsed for type TLV_TYPE_SINGLE_TV A commit was merged recently attempting to fix decoding of TLV_TYPE_SINGLE_TV. It did mostly a good job, but missed updating the o_tag pointer used to fill in the structures. This new unit test showcases the mentioned problem. A follow-up patch will fix the bug. Change-Id: Ia17c84059a413f80c2bcf194034ebac586ecf7e1 --- M tests/tlv/tlv_test.c 1 file changed, 42 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/66/32566/1 diff --git a/tests/tlv/tlv_test.c b/tests/tlv/tlv_test.c index f9137ad..aaa86a3 100644 --- a/tests/tlv/tlv_test.c +++ b/tests/tlv/tlv_test.c @@ -454,6 +454,32 @@ } } +static void test_tlv_type_single_tv(void) +{ + #define SAMPLE_SINGLE_TV_IE 0x08 + const struct tlv_definition att_tlvdef = { + .def = { + [SAMPLE_SINGLE_TV_IE] = { TLV_TYPE_SINGLE_TV, 0 }, + }, + }; + struct tlv_parsed tp; + int rc; + uint8_t exp_val = 0x03; + uint8_t buf[] = { (SAMPLE_SINGLE_TV_IE << 4) | (exp_val & 0x0f) }; + const uint8_t *val; + + rc = tlv_parse(&tp, &att_tlvdef, buf, sizeof(buf), 0, 0); + OSMO_ASSERT(rc == 1); + OSMO_ASSERT(!TLVP_PRESENT(&tp, SAMPLE_SINGLE_TV_IE)); //FIXME! + val = TLVP_VAL(&tp, SAMPLE_SINGLE_TV_IE); + OSMO_ASSERT(!val); //FIXME! +#if 0 + OSMO_ASSERT(val == &buf[0]); + OSMO_ASSERT(*val == buf[0]); + OSMO_ASSERT((*val & 0x0f) == exp_val); +#endif +} + int main(int argc, char **argv) { //osmo_init_logging2(ctx, &info); @@ -463,6 +489,7 @@ test_tlv_encoder(); test_tlv_parser_bounds(); test_tlv_lens(); + test_tlv_type_single_tv(); printf("Done.\n"); return EXIT_SUCCESS; -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/32566 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Ia17c84059a413f80c2bcf194034ebac586ecf7e1 Gerrit-Change-Number: 32566 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 250
  • 251
  • 252
  • 253
  • 254
  • 255
  • 256
  • ...
  • 259
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.