From 5e0411aa7b79261fc314a53dc03fa6a4a297c7ab Mon Sep 17 00:00:00 2001 From: INSUN PYO Date: Mon, 24 Feb 2020 14:06:30 +0900 Subject: [PATCH] Removed "route add" in rndis usb mode Ifconfig command will also automatically add route information to the routing table in the kernel. So if you run "route add" additionally, you have duplicate routing table entries. sh-3.2# route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface default 192.168.0.1 0.0.0.0 UG 0 0 0 wlan0 cns1.sec.samsun 192.168.0.1 255.255.255.255 UGH 0 0 0 wlan0 cns2.sec.samsun 192.168.0.1 255.255.255.255 UGH 0 0 0 wlan0 192.168.0.0 * 255.255.255.0 U 0 0 0 wlan0 192.168.0.1 * 255.255.255.255 UH 0 0 0 wlan0 192.168.129.0 * 255.255.255.0 U 0 0 0 usb0 <== here 192.168.129.0 * 255.255.255.0 U 0 0 0 usb0 <== here Change-Id: I96c290ce5de1da81ff7b9f99cfaefc8a64b618ac --- scripts/rndis.sh | 9 --------- 1 file changed, 9 deletions(-) diff --git a/scripts/rndis.sh b/scripts/rndis.sh index eb38cdb..66f8294 100755 --- a/scripts/rndis.sh +++ b/scripts/rndis.sh @@ -24,21 +24,12 @@ else fi ######################################################################################### -IP1=`echo $IP_ADDR | cut -d"." -f1` -IP2=`echo $IP_ADDR | cut -d"." -f2` -IP3=`echo $IP_ADDR | cut -d"." -f3` -NETWORK=$IP1"."$IP2"."$IP3"."0 - -######################################################################################### echo "rndis network inteface =" $IFNAME echo "rndis ip address =" $IP_ADDR -echo "rndis network =" $NETWORK if [ x$1 == "xstart" ] then /sbin/ifconfig $IFNAME $IP_ADDR up - /sbin/route add -net $NETWORK netmask 255.255.255.0 dev $IFNAME else - /sbin/route del -net $NETWORK netmask 255.255.255.0 dev $IFNAME /sbin/ifconfig $IFNAME down fi -- 2.7.4