Modify

Opened 2 years ago

Last modified 2 years ago

#21386 new defect

DHCP-Client does not consider metric

Reported by: alex@… Owned by: developers
Priority: normal Milestone:
Component: other Version: Attitude Adjustment 12.09
Keywords: wifi metric sta Cc:

Description

Hello!

If you specify a parameter 'metric' in file /etc/config/network for my WiFi-client interface, then the extension of the lease IPaddress disappears default route.

How it looks:

#route
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.41.1 0.0.0.0 UG 10 0 0 wlan0-1
192.168.40.0 * 255.255.255.0 U 0 0 0 br-lan
192.168.41.0 * 255.255.255.0 U 10 0 0 wlan0-1
192.168.42.0 * 255.255.255.0 U 0 0 0 wlan0

#logread
...
Dec 15 11:01:47 VPNcam daemon.notice netifd: WiFi_Client (23717): Sending select for 192.168.41.206...
Dec 15 11:01:47 VPNcam daemon.notice netifd: WiFi_Client (23717): Lease of 192.168.41.206 obtained, lease time 300
Dec 15 11:01:48 VPNcam daemon.notice netifd: Interface 'WiFi_Client' is now up
Dec 15 11:01:48 VPNcam daemon.info dnsmasq[13856]: reading /tmp/resolv.conf.auto
...

#route
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.0.0 * 255.255.255.0 U 10 0 0 eth0
192.168.40.0 * 255.255.255.0 U 0 0 0 br-lan
192.168.41.0 * 255.255.255.0 U 0 0 0 wlan0

/lib/netifd/dhcp.script script function is invoked proto_add_ipv4_route () from a script /lib/netifd/netifd-proto.sh:

proto_add_ipv4_route() {

local target="$1"
local mask="$2"
local gw="$3"

append PROTO_ROUTE "$target/$mask/$gw"

}

If I change the string 'append PROTO_ROUTE "$target/$mask/$gw"' on line 'append PROTO_ROUTE "$target/$mask/$gw/10/"' , the route will be added.
There is a 10 - metric value from the file /etc/config/network for this interface.

But for IPv6 metric value is taken into account:
"proto_add_ipv6_route() {

local target="$1"
local mask="$2"
local gw="$3"
local metric="$4"
local valid="$5"
local source="$6"

append PROTO_ROUTE6 "$target/$mask/$gw/$metric/$valid/$source"

}"

Attachments (0)

Change History (2)

comment:1 Changed 2 years ago by nbd

please try current trunk

comment:2 Changed 2 years ago by anonymous

12.09 final and 14.07

Add Comment

Modify Ticket

Action
as new .
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.