packetdrill icon indicating copy to clipboard operation
packetdrill copied to clipboard

code likely needs the SCTP_EVENTS linux kernel ABI breakage work-around

Open laf0rge opened this issue 3 years ago • 1 comments

The Linux kernel SCTP stack broke the ABI at least two times, and as packetdrill uses SCTP_EVENTS, I would expect it to also need a work-around like implemented in libosmo-netif or open5gs.

See https://git.osmocom.org/libosmo-netif/tree/src/stream.c#n118 or https://github.com/chensqi/new5gsim/blob/e0de5bca31865e12bda8a52533eb504a04f22937/lib/sctp/ogs-lksctp.c#L297 or https://osmocom.org/issues/4573

laf0rge avatar Dec 22 '21 08:12 laf0rge

SCTP_EVENTS is deprecated anyway, SCTP_EVENT is the socket option which does not have the issue of no being extensible. I think the only standardised components are

 struct sctp_event_subscribe {
     uint8_t sctp_data_io_event;
     uint8_t sctp_association_event;
     uint8_t sctp_address_event;
     uint8_t sctp_send_failure_event;
     uint8_t sctp_peer_error_event;
     uint8_t sctp_shutdown_event;
     uint8_t sctp_partial_delivery_event;
     uint8_t sctp_adaptation_layer_event;
     uint8_t sctp_authentication_event;
     uint8_t sctp_sender_dry_event;
   };

all other components at the end are implementation specific. It is assumed that you run a packetdrill binary compiled for the kernel it is running on. There are some compile time checks, but I don't think there are run time checks. Since it is a testing tool, compiling it on the platform you want to test, is acceptable, I think. However, right now, you can't test any Linux specific extensions to struct sctp_event_subscribe. But I'm also not sure why it was extended multiple times, since it is deprecated since 2011.

tuexen avatar Dec 22 '21 10:12 tuexen