#21386: DHCP-Client does not consider metric
-----------------------------+---------------------------------------
 Reporter:  alex@…           |      Owner:  developers
     Type:  defect           |     Status:  new
 Priority:  normal           |  Milestone:
Component:  other            |    Version:  Attitude Adjustment 12.09
 Keywords:  wifi metric sta  |
-----------------------------+---------------------------------------
 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"
 }"

--
Ticket URL: <https://dev.openwrt.org/ticket/21386>
OpenWrt <http://openwrt.org>
Opensource Wireless Router Technology
_______________________________________________
openwrt-tickets mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-tickets

Reply via email to