From 7ef652b1842357251147e4d70db2ac4e1a4c0fda Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Sat, 16 Apr 2022 17:25:28 +0100 Subject: [PATCH] Correction XDP file path, wwan_loop service and add hotplug iface wwan script XDP file path was in the var folder which is a virtual link to tmp folder. add hotplug script to put the script xdp on the interface wwan when the command ifup -a wwan0 is called. wwan_loop service crash on the launch, because it launched before the interface wwan set up. --- files/etc/hotplug.d/iface/99-ifup-wwan | 7 +++++++ files/{var/lib => usr/local/share}/xdp/xdp_udp.o | Bin files/usr/sbin/wwan_loop | 5 ++++- 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 files/etc/hotplug.d/iface/99-ifup-wwan rename files/{var/lib => usr/local/share}/xdp/xdp_udp.o (100%) diff --git a/files/etc/hotplug.d/iface/99-ifup-wwan b/files/etc/hotplug.d/iface/99-ifup-wwan new file mode 100644 index 0000000..0f70c70 --- /dev/null +++ b/files/etc/hotplug.d/iface/99-ifup-wwan @@ -0,0 +1,7 @@ +#!/bin/sh +[ "$ACTION" = "ifup" -a "$DEVICE" = "wwan0" ] && { + logger "iface wwan0 up detected, loading XDP..." + ip link set dev wwan0 xdp obj /usr/local/share/xdp/xdp_udp.o sec xdp_udp +} +exit 0 + diff --git a/files/var/lib/xdp/xdp_udp.o b/files/usr/local/share/xdp/xdp_udp.o similarity index 100% rename from files/var/lib/xdp/xdp_udp.o rename to files/usr/local/share/xdp/xdp_udp.o diff --git a/files/usr/sbin/wwan_loop b/files/usr/sbin/wwan_loop index b611fd2..29fef3c 100755 --- a/files/usr/sbin/wwan_loop +++ b/files/usr/sbin/wwan_loop @@ -1,3 +1,6 @@ #!/bin/sh -mmcli --modem 0 --monitor-state | while read r ; do /usr/sbin/wwan_reconnect ; done +while true; do + mmcli --modem 0 --monitor-state | while read r ; do /usr/sbin/wwan_reconnect ; done + sleep 5 +done