Removed "route add" in rndis usb mode 04/225704/1
authorINSUN PYO <insun.pyo@samsung.com>
Mon, 24 Feb 2020 05:06:30 +0000 (14:06 +0900)
committerINSUN PYO <insun.pyo@samsung.com>
Mon, 24 Feb 2020 05:06:30 +0000 (14:06 +0900)
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

index eb38cdb..66f8294 100755 (executable)
@@ -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