lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] tapif.c netmask ignored


From: salih ahi
Subject: [lwip-devel] tapif.c netmask ignored
Date: Tue, 23 Dec 2014 15:16:06 +0200

Hi,

 

When I use simhost with these parameters

./simhost -i 20.100.0.1 -g 20.100.0.98 -m 255.255.255.0  -d

 

I get this route rule in the output of “netstat –nr”

Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface

20.0.0.0        0.0.0.0         255.0.0.0       U         0 0          0 tap0

 

Although I explicitly define the netmask, it installs the network interface without passing this netmask to the system while building “buf” in tapif.c:138. This can be fixed by changing IFCONFIG_ARGS to :

 

#define IFCONFIG_ARGS "tap0 inet %d.%d.%d.%d netmask %d.%d.%d.%d"

 

and changing the sprintf function as follows:

 

sprintf(buf, IFCONFIG_BIN IFCONFIG_ARGS,

                  ip4_addr1(&(netif->gw)),

                  ip4_addr2(&(netif->gw)),

                  ip4_addr3(&(netif->gw)),

                  ip4_addr4(&(netif->gw)),

                  ip4_addr1(&(netif->netmask)),

                  ip4_addr2(&(netif->netmask)),

                  ip4_addr3(&(netif->netmask)),

                  ip4_addr4(&(netif->netmask))

                  );

Btw, I encountered this on Centos 7

 

Regards,

Salih


reply via email to

[Prev in Thread] Current Thread [Next in Thread]