From 6ca6265f7ea821cda292ef89ac77ba98bdf20cd2 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Fri, 28 Mar 2025 22:19:47 -0700 Subject: openl2tp: Replace ifconfig with ip command in ptest run script ifconfig may not exist on all systems since its deprecated, fixes ptests Signed-off-by: Khem Raj --- meta-networking/recipes-protocols/openl2tp/openl2tp/run-ptest | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'meta-networking') diff --git a/meta-networking/recipes-protocols/openl2tp/openl2tp/run-ptest b/meta-networking/recipes-protocols/openl2tp/openl2tp/run-ptest index b8fb08b758..a40b6c4228 100644 --- a/meta-networking/recipes-protocols/openl2tp/openl2tp/run-ptest +++ b/meta-networking/recipes-protocols/openl2tp/openl2tp/run-ptest @@ -34,7 +34,7 @@ ETH_TEST=`ip route get 8.8.8.8 | awk -- '{print $5}'` if [ x"$ETH_TEST" = x ]; then exit_cus "The network interface cannot be null" 1 fi -ifconfig | grep $ETH_TEST > /dev/null || exit_cus "The network interface you provide is invalid" 1 +ip a | grep $ETH_TEST > /dev/null || exit_cus "The network interface you provide is invalid" 1 # check openl2tp related kernel config zcat /proc/config.gz | grep CONFIG_L2TP=y > /dev/null || exit_cus "Failed to check CONFIG_L2TP=y, skip the tests." 1 @@ -61,8 +61,7 @@ if [ x"$ETH_TEST" = x ]; then fi sed -i 's/eth2/'\"$ETH_TEST\"'/g' ${OPENL2TP_DIR}/ptest/test_procs.tcl -test_ip="`ifconfig $ETH_TEST | grep 'inet ' | sed 's/^.*inet addr://g' | \ - sed 's/ *Mask.*$//g'|sed 's/ *Bcast.*$//g'`" +test_ip="`ip addr show $ETH_TEST | grep 'inet ' | grep -v '127.0.0.1' | awk '{print $2}' | cut -d '/' -f1`" sed -i 's/192.168.0.1/'"$test_ip"'/g' ${OPENL2TP_DIR}/ptest/tunnel.test # load module l2tp_ppp -- cgit v1.2.3-54-g00ecf