[PATCH 01/20] sysmo-bts: Use correct boundaries of L1 msg when forwarding to L1 proxy

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/OpenBSC@lists.osmocom.org/.

Alexander Chemeris alexander.chemeris at gmail.com
Sun Oct 6 20:57:35 UTC 2013


Good catch. Using msg->head is a fragile business.

On Thu, Sep 19, 2013 at 2:11 PM, Andreas Eversberg <jolly at eversberg.eu> wrote:
> In case of a headroom in a message, the 'head' pointer will not point to
> the actual data.
> ---
>  src/osmo-bts-sysmo/l1_transp_fwd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/osmo-bts-sysmo/l1_transp_fwd.c b/src/osmo-bts-sysmo/l1_transp_fwd.c
> index 5050705..87c230b 100644
> --- a/src/osmo-bts-sysmo/l1_transp_fwd.c
> +++ b/src/osmo-bts-sysmo/l1_transp_fwd.c
> @@ -95,7 +95,7 @@ static int fwd_read_cb(struct osmo_fd *ofd)
>  static int prim_write_cb(struct osmo_fd *ofd, struct msgb *msg)
>  {
>         /* write to the fd */
> -       return write(ofd->fd, msg->head, msg->len);
> +       return write(ofd->fd, msg->l1h, msgb_l1len(msg));
>  }
>
>  int l1if_transport_open(int q, struct femtol1_hdl *fl1h)
> --
> 1.8.1.5
>
>



-- 
Regards,
Alexander Chemeris.
CEO, Fairwaves LLC / ООО УмРадио
http://fairwaves.ru




More information about the OpenBSC mailing list