[PATCH 1/3] Introduce new phy_link and phy_instance abstraction

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/.

Holger Freyther holger at freyther.de
Fri Feb 5 12:37:00 UTC 2016


> On 05 Feb 2016, at 12:41, Harald Welte <laforge at gnumonks.org> wrote:
> 
> 
> +struct phy_link *phy_link_create(void *ctx, int num)
> +{
> +	struct phy_link *plink = talloc_zero(ctx, struct phy_link);
> +
> +	if (phy_link_by_num(num))
> +		return NULL;
> +
> +	plink = talloc_zero(ctx, struct phy_link);


small memleak. plink being assigned twice.


> 
> +struct phy_instance *phy_instance_create(struct phy_link *plink, int num)
> +{
> +	struct phy_instance *pinst = talloc_zero(plink, struct phy_instance);
> +
> +	if (phy_instance_by_num(plink, num))
> +		return NULL;
> +
> +	pinst = talloc_zero(plink, struct phy_instance);

same small leak.





> @@ -518,6 +522,7 @@ static int mph_send_config_ciphering(struct gsm_lchan *lchan, struct sapi_cmd *c
> 	l1if_fill_msg_hdr(&pcc->Header, msg, fl1h, cOCTVC1_MSG_TYPE_COMMAND,
> 			  cOCTVC1_GSM_MSG_TRX_MODIFY_PHYSICAL_CHANNEL_CIPHERING_CID);
> 
> +	pcc->TrxId.byTrxId = pinst->u.octphy.trx_id;


ah nice, is there another way we could check that all primitives have all zero based indices set?




okay ran out of time here. The octphy change looked good, mechanical, already fixing byTrxId assignment in case there will be more than one phy.

holger





More information about the OpenBSC mailing list