[osmocom-event-orga] osmoserv online

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

Peter Stuge peter at stuge.se
Sun Dec 9 03:54:27 UTC 2018


Hi,

Neels Hofmeyr wrote:
> I'm getting this error and osmo-stp cannot accept connections:
> 
> Dec 08 19:06:13 gsmcore osmo-stp[63]: 20181208190613528 DLINP DEBUG accept()ed new link from 127.0.0.1 to port 2905 (stream.c:585)
> Dec 08 19:06:13 gsmcore osmo-stp[63]: 20181208190613528 DLINP ERROR coudldn't activate SCTP events on FD 7 (stream.c:95)

This is due to a struct sctp_event_subscribe definition mismatch between

--8<-- gsmcore:/usr/include/linux/sctp.h:582
struct sctp_event_subscribe {
        __u8 sctp_data_io_event;
        __u8 sctp_association_event;
        __u8 sctp_address_event;
        __u8 sctp_send_failure_event;
        __u8 sctp_peer_error_event;
        __u8 sctp_shutdown_event;
        __u8 sctp_partial_delivery_event;
        __u8 sctp_adaptation_layer_event;
        __u8 sctp_authentication_event;
        __u8 sctp_sender_dry_event;
        __u8 sctp_stream_reset_event;
        __u8 sctp_assoc_reset_event;
        __u8 sctp_stream_change_event;
};
-->8--

( which gets used at /srv/35c3/src/libosmo-netif/src/stream.c:76 )

and the osmoserv kernel struct

--8<-- osmoserv:/root/linux*1/include/uapi/linux/sctp.h:484
struct sctp_event_subscribe {
        __u8 sctp_data_io_event;
        __u8 sctp_association_event;
        __u8 sctp_address_event;
        __u8 sctp_send_failure_event;
        __u8 sctp_peer_error_event;
        __u8 sctp_shutdown_event;
        __u8 sctp_partial_delivery_event;
        __u8 sctp_adaptation_layer_event;
        __u8 sctp_authentication_event;
        __u8 sctp_sender_dry_event;
};
-->8--

The osmoserv kernel code looks like this:

--8<--
static int sctp_setsockopt_events(struct sock *sk, char __user *optval,
                                  unsigned int optlen)
{
        struct sctp_association *asoc;
        struct sctp_ulpevent *event;

        if (optlen > sizeof(struct sctp_event_subscribe))
                return -EINVAL;
...
-->8--

The three additional struct members in the debian header file cause
the above struct size check to fail.

(Please remember to include the kernel errno in userspace error messages.
In this case the issue is clear anyway, but that's not always the case.)

The linux-libc-dev debian package which provides the header file is
based on debian kernel version 4.18.20-2, while the osmoserv kernel
was a 4.9 longterm version.

Somewhat reluctantly (real bad block layer bug fixed only the other day)
I've updated osmoserv to 4.19.8, that has all struct members in the
debian header, so osmo-stp should just work<tm> now.


//Peter



More information about the osmocom-event-orga mailing list