PrinzOwO / gtp5g

Linux kernel module 5G GTP-U

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Get Linux kernel module 5G GTP-U Problem

Lahbak opened this issue · comments

after this commands
git clone https://github.com/PrinzOwO/gtp5g.git
cd gtp5g
make
sudo make install
I take this result :
make -C /usr/src/linux-headers-5.3.0-53-generic/ M=/root/go/src/free5gc/gtp5g modules
make[1]: Entering directory '/usr/src/linux-headers-5.3.0-53-generic'
CC [M] /root/go/src/free5gc/gtp5g/gtp5g.o
/root/go/src/free5gc/gtp5g/gtp5g.c: In function ‘ip4_find_route’:
/root/go/src/free5gc/gtp5g/gtp5g.c:766:2: error: too few arguments to function ‘rt->dst.ops->update_pmtu’
rt->dst.ops->update_pmtu(&rt->dst, NULL, skb, mtu);
^~
scripts/Makefile.build:288: recipe for target '/root/go/src/free5gc/gtp5g/gtp5g.o' failed
make[2]: *** [/root/go/src/free5gc/gtp5g/gtp5g.o] Error 1
Makefile:1656: recipe for target 'module/root/go/src/free5gc/gtp5g' failed
make[1]: *** [module/root/go/src/free5gc/gtp5g] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.3.0-53-generic'
Makefile:10: recipe for target 'all' failed
make: *** [all] Error 2
Can you please help me for this problem ?

@Lahbak ,
the reason for this compilation error comes from torvalds/linux@bd085ef added one more parameter for dst_ops.update_pmtu, so we have to do conditional compilation for both old and new kernels. I create a pull request for solving this issue. #3
FYI.

I try to change kernel version to 5.0.0-23 and I get this :
root@free5g:/go/src/free5gc# git clone https://github.com/PrinzOwO/gtp5g.git
Cloning into 'gtp5g'...
remote: Enumerating objects: 31, done.
remote: Counting objects: 100% (31/31), done.
remote: Compressing objects: 100% (22/22), done.
remote: Total 31 (delta 13), reused 22 (delta 8), pack-reused 0
Unpacking objects: 100% (31/31), done.
root@free5g:
/go/src/free5gc# cd gtp5g
root@free5g:/go/src/free5gc/gtp5g# make
make -C /usr/src/linux-headers-5.0.0-23-generic/ M=/root/go/src/free5gc/gtp5g modules
make[1]: *** /usr/src/linux-headers-5.0.0-23-generic/: No such file or directory. Stop.
Makefile:10: recipe for target 'all' failed
make: *** [all] Error 2
root@free5g:
/go/src/free5gc/gtp5g# sudo make install
modprobe udp_tunnel
insmod gtp5g.ko
insmod: ERROR: could not load module gtp5g.ko: No such file or directory
Makefile:15: recipe for target 'install' failed
make: *** [install] Error 1

Also when I try to compile gtp5g.c it show me this result :
gtp5g.c:11:10: fatal error: linux/skbuff.h: No such file or directory
#include <linux/skbuff.h>
^~~~~~~~~~~~~~~~
compilation terminated.

@Lahbak,
you should install linux kernel header files by sudo apt-get install linux-headers-5.0.0-23

I install it sucessfully then the gtp5.ko is generated but it still the problem of compilation when I do
gcc gtp5g.c
it show me always :
gtp5g.c:11:10: fatal error: linux/skbuff.h: No such file or directory
#include <linux/skbuff.h>
^~~~~~~~~~~~~~~~
compilation terminated.

@Lahbak you can read the Makefile to understand what it does, directly invoke gcc will fail due to no header inclusion paths set.

Ok
when i Run Network function like AMF, it shows me this message :
AMF register to NRF Error[Put https://localhost:29510/nnrf-nfm/v1/nf-instances/144c100f-299f-47bf-bdc5-c81883718f05: dial tcp 127.0.0.1:29510: connect: connection refused]
?
What is the problem here ?