iuh: Coverity build breakage because of old sctp

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

Neels Hofmeyr nhofmeyr at sysmocom.de
Wed Apr 6 23:12:41 UTC 2016


On Wed, Apr 06, 2016 at 09:26:57PM +0200, Holger Freyther wrote:
> Hi,
> 
> sua.c: In function 'rx_inact_tmr_cb':
> sua.c:288: warning: unused variable 'conn'
> sua.c: In function 'sua_rx_coref':
> sua.c:908: warning: unused variable 'cause'
> sua.c: In function 'sua_rx_codt':
> sua.c:1059: warning: unused variable 'cur'
> sua.c: In function 'sua_srv_conn_cb':
> sua.c:1266: error: 'SCTP_SENDER_DRY_EVENT' undeclared (first use in this function)
> sua.c:1266: error: (Each undeclared identifier is reported only once
> sua.c:1266: error: for each function it appears in.)
> sua.c: In function 'sua_cli_read_cb':
> sua.c:1451: error: 'SCTP_SENDER_DRY_EVENT' undeclared (first use in this function)
> 
> can we make the SCTP_SENDER_DRY_EVENT optional or is a strict requirement? If it is strict then maybe we can check for this in autoconf?

It's completely unnecessary, I only added logging for it.  Before, it printed a
notification for "32777", and we surely want to know what that's supposed to
mean.

We could add a conditional define like

	#ifndef SCTP_SENDER_DRY_EVENT
	#define SCTP_SENDER_DRY_EVENT ((1<<15)+9)
	#endif

because sctp.h defines the value both as enum *and* as a #define:

	enum sctp_sn_type {
		SCTP_SN_TYPE_BASE     = (1<<15),
		SCTP_ASSOC_CHANGE,
	#define SCTP_ASSOC_CHANGE SCTP_ASSOC_CHANGE
		SCTP_PEER_ADDR_CHANGE,
	#define SCTP_PEER_ADDR_CHANGE SCTP_PEER_ADDR_CHANGE
		SCTP_SEND_FAILED,
	#define SCTP_SEND_FAILED SCTP_SEND_FAILED
		SCTP_REMOTE_ERROR,
	#define SCTP_REMOTE_ERROR SCTP_REMOTE_ERROR
		SCTP_SHUTDOWN_EVENT,
	#define SCTP_SHUTDOWN_EVENT SCTP_SHUTDOWN_EVENT
		SCTP_PARTIAL_DELIVERY_EVENT,
	#define SCTP_PARTIAL_DELIVERY_EVENT SCTP_PARTIAL_DELIVERY_EVENT
		SCTP_ADAPTATION_INDICATION,
	#define SCTP_ADAPTATION_INDICATION SCTP_ADAPTATION_INDICATION
		SCTP_AUTHENTICATION_INDICATION,
	#define SCTP_AUTHENTICATION_INDICATION SCTP_AUTHENTICATION_INDICATION
		SCTP_SENDER_DRY_EVENT,
	#define SCTP_SENDER_DRY_EVENT SCTP_SENDER_DRY_EVENT
	};

Not sure though whether we should rely on this.

I could also hardcode 32777, but that's not such a good idea either.

Last resort is to not log the event and hope that all of us know what 32777 is
all about.

~Neels

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.osmocom.org/pipermail/openbsc/attachments/20160407/fbc3dba1/attachment.bin>


More information about the OpenBSC mailing list