sipwise / rtpengine

The Sipwise media proxy for Kamailio
GNU General Public License v3.0
798 stars 374 forks source link

Can not install rtpengine module on core 5.8.0-45-generic #1212

Open kertor opened 3 years ago

kertor commented 3 years ago

Hello! Have problem with rtpengine install on 20.04.1-Ubuntu (core 5.8.0-45-generic):

Linux r6-c2-n1 5.8.0-45-generic #51~20.04.1-Ubuntu SMP Tue Feb 23 13:46:31 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

On 20.04.1-Ubuntu (core 5.8.0-33-generic) install is working well:

Linux r6-c1-n1 5.8.0-33-generic #36~20.04.1-Ubuntu SMP Wed Dec 9 17:01:13 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

dkms install:

~# dkms install -m ngcp-rtpengine -v 9.4.0.0~20210303~def813c

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area...
make -j32 KERNELRELEASE=5.8.0-45-generic -C /lib/modules/5.8.0-45-generic/build M=/var/lib/dkms/ngcp-rtpengine/9.4.0.0~20210303~def813c/build RTPENGINE_VERSION=9.4.0.0~20210303~def813c...(bad exit status: 2)
ERROR: Cannot create report: [Errno 17] File exists: '/var/crash/ngcp-rtpengine-kernel-dkms.0.crash'
Error! Bad return status for module build on kernel: 5.8.0-45-generic (x86_64)
Consult /var/lib/dkms/ngcp-rtpengine/9.4.0.0~20210303~def813c/build/make.log for more information.

Report ngcp-rtpengine-kernel-dkms.0.crash.txt attached. ngcp-rtpengine-kernel-dkms.0.crash.txt

Could you please check this? Thank you!

rfuchs commented 3 years ago

Looks like Ubuntu is using a patched kernel which fails the version test. In this package they have

VERSION = 5
PATCHLEVEL = 8
SUBLEVEL = 18

with the function prototype being int ip_route_me_harder(struct net *net, struct sock *sk, struct sk_buff *skb, unsigned addr_type); which is different from the mainline kernel with the same version: https://elixir.bootlin.com/linux/v5.8.18/source/include/linux/netfilter_ipv4.h

rfuchs commented 3 years ago

You can work around this yourself by adapting the version test macro here https://github.com/sipwise/rtpengine/blob/master/kernel-module/xt_RTPENGINE.c#L3435 and here https://github.com/sipwise/rtpengine/blob/master/kernel-module/xt_RTPENGINE.c#L3535 but I don't see a way to incorporate this into the code without breaking non-Ubuntu kernels since there doesn't seem to be a way to distinguish their patched kernel from mainline.

kertor commented 3 years ago

Thank you for detailed answer.

cmendes0101 commented 3 years ago

I was having the same issue on Ubuntu 20.04.2 LTS and just did apt-get upgrade and it updated the module and everything is working now.

I didn't mark down the versions but I'll edit when I run this again on another box.