On Fri, Oct 25 2019 14:53:01 +0300, Lauri Tirkkonen wrote: > god dammit, I'm not initializing oldlinkup. sorry, retesting and sending > new results, please ignore previous...
fixed diff of manual revert of dhclient.c r1.634: diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c index c5d197ee274..c0a435fa61c 100644 --- a/sbin/dhclient/dhclient.c +++ b/sbin/dhclient/dhclient.c @@ -345,6 +345,7 @@ rtm_dispatch(struct interface_info *ifi, struct rt_msghdr *rtm) struct ifa_msghdr *ifam; struct if_ieee80211_data *ifie; uint32_t oldmtu; + int oldlinkup; switch (rtm->rtm_type) { case RTM_PROPOSAL: @@ -389,12 +390,15 @@ rtm_dispatch(struct interface_info *ifi, struct rt_msghdr *rtm) } oldmtu = ifi->mtu; + oldlinkup = LINK_STATE_IS_UP(ifi->link_state); interface_state(ifi); - if (oldmtu == ifi->mtu) - quit = RESTART; - else - log_debug("%s: MTU change RTM_IFINFO ignored", - log_procname); + if (LINK_STATE_IS_UP(ifi->link_state) != oldlinkup) { + if (oldmtu == ifi->mtu) + quit = RESTART; + else + log_debug("%s: MTU change RTM_IFINFO ignored", + log_procname); + } break; case RTM_80211INFO: and fixed results. first, "bad" (just resending previous "bad" result, since no change occurred in this code): $ cat test.bad + dhclient vio0 + route monitor + > route-monitor.bad + sleep 1 + ifconfig vio0 vio0: flags=808843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,AUTOCONF4> mtu 1500 lladdr 96:00:00:34:06:8e llprio 3 groups: egress media: Ethernet autoselect status: active inet 95.217.7.62 netmask 0xffffffff + ping -c 1 1.1.1.1 PING 1.1.1.1 (1.1.1.1): 56 data bytes 64 bytes from 1.1.1.1: icmp_seq=0 ttl=57 time=18.778 ms --- 1.1.1.1 ping statistics --- 1 packets transmitted, 1 packets received, 0.0% packet loss round-trip min/avg/max/std-dev = 18.778/18.778/18.778/0.000 ms + ifconfig vio0 -soii + sleep 1 + ping -c 1 1.1.1.1 ping: sendmsg: Invalid argument PING 1.1.1.1 (1.1.1.1): 56 data bytes ping: wrote 1.1.1.1 64 chars, ret=-1 --- 1.1.1.1 ping statistics --- 1 packets transmitted, 0 packets received, 100.0% packet loss + ifconfig vio0 vio0: flags=c08843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,INET6_NOSOII,AUTOCONF4> mtu 1500 lladdr 96:00:00:34:06:8e llprio 3 groups: egress media: Ethernet autoselect status: active inet 95.217.7.62 netmask 0xffffffff + kill -INT %1 $ cat route-monitor.bad got message of size 168 on Fri Oct 25 11:45:38 2019 RTM_IFINFO: iface status change: len 168, if# 1, name: vio0, link: active, mtu: 1500, flags:<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> got message of size 168 on Fri Oct 25 11:45:38 2019 RTM_IFINFO: iface status change: len 168, if# 1, name: vio0, link: active, mtu: 1500, flags:<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> got message of size 168 on Fri Oct 25 11:45:38 2019 RTM_IFINFO: iface status change: len 168, if# 1, name: vio0, link: active, mtu: 1500, flags:<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> got message of size 168 on Fri Oct 25 11:45:38 2019 RTM_IFINFO: iface status change: len 168, if# 1, name: vio0, link: active, mtu: 1500, flags:<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> got message of size 96 on Fri Oct 25 11:45:38 2019 RTM_PROPOSAL: config proposal: len 96, source dhcp table 0, ifidx 1, pid: 22261, seq -593891804, errno 0 flags:<UP,DONE,PROTO3> fmask: use: 0 mtu: 0 expire: 0 locks: inits: Static Routes: Domain search: Domain Name Servers: got message of size 96 on Fri Oct 25 11:45:38 2019 RTM_NEWADDR: address being added to iface: len 96, metric 0, flags: sockaddrs: <NETMASK,IFP,IFA,BRD> 255.255.255.255 96:00:00:34:06:8e 95.217.7.62 0.0.0.0 got message of size 192 on Fri Oct 25 11:45:38 2019 RTM_ADD: Add Route: len 192, priority 1, table 0, ifidx 1, pid: 0, seq 0, errno 0 flags:<UP,HOST,DONE,LLINFO,LOCAL> fmask: use: 0 mtu: 0 expire: 0 locks: inits: sockaddrs: <DST,GATEWAY,IFP,IFA> 95.217.7.62 96:00:00:34:06:8e 96:00:00:34:06:8e 95.217.7.62 got message of size 192 on Fri Oct 25 11:45:38 2019 RTM_ADD: Add Route: len 192, priority 4, table 0, ifidx 1, pid: 0, seq 0, errno 0 flags:<UP,DONE,CLONING,CONNECTED> fmask: use: 0 mtu: 0 expire: 0 locks: inits: sockaddrs: <DST,GATEWAY,NETMASK,IFP,IFA> 95.217.7.62 95.217.7.62 255.255.255.255 96:00:00:34:06:8e 95.217.7.62 got message of size 192 on Fri Oct 25 11:45:38 2019 RTM_ADD: Add Route: len 192, priority 8, table 0, ifidx 1, pid: 678, seq 0, errno 0 flags:<UP,DONE,CLONING,STATIC> fmask: use: 0 mtu: 0 expire: 0 locks: inits: sockaddrs: <DST,GATEWAY,NETMASK,IFP,IFA> 172.31.1.1 95.217.7.62 255.255.255.255 96:00:00:34:06:8e 95.217.7.62 got message of size 144 on Fri Oct 25 11:45:38 2019 RTM_ADD: Add Route: len 144, priority 0, table 0, ifidx 1, pid: 678, seq 0, errno 17 flags:<CLONING,STATIC> fmask: use: 0 mtu: 0 expire: 0 locks: inits: sockaddrs: <DST,GATEWAY,NETMASK> 172.31.1.1 95.217.7.62 255.255.255.255 got message of size 192 on Fri Oct 25 11:45:38 2019 RTM_ADD: Add Route: len 192, priority 7, table 0, ifidx 1, pid: 0, seq 0, errno 0 flags:<UP,HOST,DONE,LLINFO,CLONED> fmask: use: 0 mtu: 0 expire: 0 locks: inits: sockaddrs: <DST,GATEWAY,IFP,IFA> 172.31.1.1 link#1 96:00:00:34:06:8e 95.217.7.62 got message of size 192 on Fri Oct 25 11:45:38 2019 RTM_ADD: Add Route: len 192, priority 8, table 0, ifidx 1, pid: 678, seq 0, errno 0 flags:<UP,GATEWAY,DONE,STATIC> fmask: use: 0 mtu: 0 expire: 0 locks: inits: sockaddrs: <DST,GATEWAY,NETMASK,IFP,IFA> 0.0.0.0 172.31.1.1 0.0.0.0 96:00:00:34:06:8e 95.217.7.62 got message of size 192 on Fri Oct 25 11:45:38 2019 RTM_GET: Report Metrics: len 192, priority 8, table 0, ifidx 1, pid: 678, seq -1688123477, errno 0 flags:<UP,GATEWAY,DONE,STATIC> fmask: use: 0 mtu: 0 expire: 0 locks: inits: sockaddrs: <DST,GATEWAY,NETMASK,IFP,IFA> 0.0.0.0 172.31.1.1 0.0.0.0 96:00:00:34:06:8e 95.217.7.62 got message of size 192 on Fri Oct 25 11:45:38 2019 RTM_GET: Report Metrics: len 192, priority 8, table 0, ifidx 1, pid: 678, seq -2029380539, errno 0 flags:<UP,GATEWAY,DONE,STATIC> fmask: use: 0 mtu: 0 expire: 0 locks: inits: sockaddrs: <DST,GATEWAY,NETMASK,IFP,IFA> 0.0.0.0 172.31.1.1 0.0.0.0 96:00:00:34:06:8e 95.217.7.62 got message of size 192 on Fri Oct 25 11:45:39 2019 RTM_RESOLVE: Route created by cloning: len 192, priority 7, table 0, ifidx 1, pid: 0, seq 0, errno 0 flags:<UP,HOST,DONE,LLINFO,CLONED,CACHED> fmask: use: 0 mtu: 0 expire: 0 locks: inits: sockaddrs: <DST,GATEWAY,IFP,IFA> 172.31.1.1 d2:74:7f:6e:37:e3 96:00:00:34:06:8e 95.217.7.62 got message of size 168 on Fri Oct 25 11:45:39 2019 RTM_IFINFO: iface status change: len 168, if# 1, name: vio0, link: active, mtu: 1500, flags:<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,INET6_NOSOII> got message of size 192 on Fri Oct 25 11:45:39 2019 RTM_GET: Report Metrics: len 192, priority 8, table 0, ifidx 1, pid: 678, seq 870724543, errno 0 flags:<UP,GATEWAY,DONE,STATIC> fmask: use: 1 mtu: 0 expire: 0 locks: inits: sockaddrs: <DST,GATEWAY,NETMASK,IFP,IFA> 0.0.0.0 172.31.1.1 0.0.0.0 96:00:00:34:06:8e 95.217.7.62 got message of size 208 on Fri Oct 25 11:45:39 2019 RTM_DELETE: Delete Route: len 208, priority 7, table 0, ifidx 1, pid: 678, seq 0, errno 0 flags:<UP,HOST,DONE,LLINFO,CLONED,CACHED> fmask: use: 2 mtu: 0 expire: 1200 locks: inits: sockaddrs: <DST,GATEWAY,NETMASK,IFP,IFA> 172.31.1.1 link#1 255.255.255.255 96:00:00:34:06:8e 95.217.7.62 got message of size 192 on Fri Oct 25 11:45:39 2019 RTM_DELETE: Delete Route: len 192, priority 7, table 0, ifidx 1, pid: 0, seq 0, errno 0 flags:<HOST,DONE,CLONED,CACHED> fmask: use: 0 mtu: 0 expire: 0 locks: inits: sockaddrs: <DST,GATEWAY,IFP,IFA> 172.31.1.1 link#1 96:00:00:34:06:8e 95.217.7.62 got message of size 192 on Fri Oct 25 11:45:39 2019 RTM_DELETE: Delete Route: len 192, priority 8, table 0, ifidx 1, pid: 678, seq 1, errno 0 flags:<DONE,CLONING,STATIC> fmask: use: 0 mtu: 0 expire: 0 locks: inits: sockaddrs: <DST,GATEWAY,NETMASK,IFP,IFA> 172.31.1.1 95.217.7.62 255.255.255.255 96:00:00:34:06:8e 95.217.7.62 got message of size 192 on Fri Oct 25 11:45:39 2019 RTM_ADD: Add Route: len 192, priority 8, table 0, ifidx 1, pid: 678, seq 0, errno 0 flags:<UP,DONE,CLONING,STATIC> fmask: use: 0 mtu: 0 expire: 0 locks: inits: sockaddrs: <DST,GATEWAY,NETMASK,IFP,IFA> 172.31.1.1 95.217.7.62 255.255.255.255 96:00:00:34:06:8e 95.217.7.62 got message of size 144 on Fri Oct 25 11:45:39 2019 RTM_ADD: Add Route: len 144, priority 0, table 0, ifidx 1, pid: 678, seq 0, errno 17 flags:<CLONING,STATIC> fmask: use: 0 mtu: 0 expire: 0 locks: inits: sockaddrs: <DST,GATEWAY,NETMASK> 172.31.1.1 95.217.7.62 255.255.255.255 got message of size 192 on Fri Oct 25 11:45:39 2019 RTM_ADD: Add Route: len 192, priority 7, table 0, ifidx 1, pid: 0, seq 0, errno 0 flags:<UP,HOST,DONE,LLINFO,CLONED> fmask: use: 0 mtu: 0 expire: 0 locks: inits: sockaddrs: <DST,GATEWAY,IFP,IFA> 172.31.1.1 link#1 96:00:00:34:06:8e 95.217.7.62 got message of size 160 on Fri Oct 25 11:45:39 2019 RTM_ADD: Add Route: len 160, priority 0, table 0, ifidx 1, pid: 678, seq 0, errno 17 flags:<GATEWAY,STATIC> fmask: use: 0 mtu: 0 expire: 0 locks: inits: sockaddrs: <DST,GATEWAY,NETMASK,IFA> 0.0.0.0 172.31.1.1 0.0.0.0 95.217.7.62 got message of size 192 on Fri Oct 25 11:45:39 2019 RTM_GET: Report Metrics: len 192, priority 8, table 0, ifidx 1, pid: 678, seq -1044169088, errno 0 flags:<UP,GATEWAY,DONE,STATIC> fmask: use: 1 mtu: 0 expire: 0 locks: inits: sockaddrs: <DST,GATEWAY,NETMASK,IFP,IFA> 0.0.0.0 172.31.1.1 0.0.0.0 96:00:00:34:06:8e 95.217.7.62 then, "good" results with the fixed diff: $ cat test.good + dhclient vio0 + route monitor + > route-monitor.good + sleep 1 + ifconfig vio0 vio0: flags=808843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,AUTOCONF4> mtu 1500 lladdr 96:00:00:34:06:8e llprio 3 groups: egress media: Ethernet autoselect status: active inet 95.217.7.62 netmask 0xffffffff + ping -c 1 1.1.1.1 PING 1.1.1.1 (1.1.1.1): 56 data bytes 64 bytes from 1.1.1.1: icmp_seq=0 ttl=57 time=7.798 ms --- 1.1.1.1 ping statistics --- 1 packets transmitted, 1 packets received, 0.0% packet loss round-trip min/avg/max/std-dev = 7.798/7.798/7.798/0.000 ms + ifconfig vio0 -soii + sleep 1 + ping -c 1 1.1.1.1 PING 1.1.1.1 (1.1.1.1): 56 data bytes 64 bytes from 1.1.1.1: icmp_seq=0 ttl=57 time=7.962 ms --- 1.1.1.1 ping statistics --- 1 packets transmitted, 1 packets received, 0.0% packet loss round-trip min/avg/max/std-dev = 7.962/7.962/7.962/0.000 ms + ifconfig vio0 vio0: flags=c08843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,INET6_NOSOII,AUTOCONF4> mtu 1500 lladdr 96:00:00:34:06:8e llprio 3 groups: egress media: Ethernet autoselect status: active inet 95.217.7.62 netmask 0xffffffff + kill -INT %1 $ cat route-monitor.good got message of size 168 on Fri Oct 25 12:00:10 2019 RTM_IFINFO: iface status change: len 168, if# 1, name: vio0, link: active, mtu: 1500, flags:<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> got message of size 168 on Fri Oct 25 12:00:10 2019 RTM_IFINFO: iface status change: len 168, if# 1, name: vio0, link: active, mtu: 1500, flags:<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> got message of size 168 on Fri Oct 25 12:00:10 2019 RTM_IFINFO: iface status change: len 168, if# 1, name: vio0, link: active, mtu: 1500, flags:<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> got message of size 168 on Fri Oct 25 12:00:10 2019 RTM_IFINFO: iface status change: len 168, if# 1, name: vio0, link: active, mtu: 1500, flags:<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> got message of size 96 on Fri Oct 25 12:00:10 2019 RTM_PROPOSAL: config proposal: len 96, source dhcp table 0, ifidx 1, pid: 46916, seq -588812676, errno 0 flags:<UP,DONE,PROTO3> fmask: use: 0 mtu: 0 expire: 0 locks: inits: Static Routes: Domain search: Domain Name Servers: got message of size 96 on Fri Oct 25 12:00:11 2019 RTM_NEWADDR: address being added to iface: len 96, metric 0, flags: sockaddrs: <NETMASK,IFP,IFA,BRD> 255.255.255.255 96:00:00:34:06:8e 95.217.7.62 0.0.0.0 got message of size 192 on Fri Oct 25 12:00:11 2019 RTM_ADD: Add Route: len 192, priority 1, table 0, ifidx 1, pid: 0, seq 0, errno 0 flags:<UP,HOST,DONE,LLINFO,LOCAL> fmask: use: 0 mtu: 0 expire: 0 locks: inits: sockaddrs: <DST,GATEWAY,IFP,IFA> 95.217.7.62 96:00:00:34:06:8e 96:00:00:34:06:8e 95.217.7.62 got message of size 192 on Fri Oct 25 12:00:11 2019 RTM_ADD: Add Route: len 192, priority 4, table 0, ifidx 1, pid: 0, seq 0, errno 0 flags:<UP,DONE,CLONING,CONNECTED> fmask: use: 0 mtu: 0 expire: 0 locks: inits: sockaddrs: <DST,GATEWAY,NETMASK,IFP,IFA> 95.217.7.62 95.217.7.62 255.255.255.255 96:00:00:34:06:8e 95.217.7.62 got message of size 192 on Fri Oct 25 12:00:11 2019 RTM_ADD: Add Route: len 192, priority 8, table 0, ifidx 1, pid: 96365, seq 0, errno 0 flags:<UP,DONE,CLONING,STATIC> fmask: use: 0 mtu: 0 expire: 0 locks: inits: sockaddrs: <DST,GATEWAY,NETMASK,IFP,IFA> 172.31.1.1 95.217.7.62 255.255.255.255 96:00:00:34:06:8e 95.217.7.62 got message of size 144 on Fri Oct 25 12:00:11 2019 RTM_ADD: Add Route: len 144, priority 0, table 0, ifidx 1, pid: 96365, seq 0, errno 17 flags:<CLONING,STATIC> fmask: use: 0 mtu: 0 expire: 0 locks: inits: sockaddrs: <DST,GATEWAY,NETMASK> 172.31.1.1 95.217.7.62 255.255.255.255 got message of size 192 on Fri Oct 25 12:00:11 2019 RTM_ADD: Add Route: len 192, priority 7, table 0, ifidx 1, pid: 0, seq 0, errno 0 flags:<UP,HOST,DONE,LLINFO,CLONED> fmask: use: 0 mtu: 0 expire: 0 locks: inits: sockaddrs: <DST,GATEWAY,IFP,IFA> 172.31.1.1 link#1 96:00:00:34:06:8e 95.217.7.62 got message of size 192 on Fri Oct 25 12:00:11 2019 RTM_ADD: Add Route: len 192, priority 8, table 0, ifidx 1, pid: 96365, seq 0, errno 0 flags:<UP,GATEWAY,DONE,STATIC> fmask: use: 0 mtu: 0 expire: 0 locks: inits: sockaddrs: <DST,GATEWAY,NETMASK,IFP,IFA> 0.0.0.0 172.31.1.1 0.0.0.0 96:00:00:34:06:8e 95.217.7.62 got message of size 192 on Fri Oct 25 12:00:11 2019 RTM_RESOLVE: Route created by cloning: len 192, priority 7, table 0, ifidx 1, pid: 0, seq 0, errno 0 flags:<UP,HOST,DONE,LLINFO,CLONED,CACHED> fmask: use: 0 mtu: 0 expire: 0 locks: inits: sockaddrs: <DST,GATEWAY,IFP,IFA> 172.31.1.1 d2:74:7f:6e:37:e3 96:00:00:34:06:8e 95.217.7.62 got message of size 192 on Fri Oct 25 12:00:11 2019 RTM_GET: Report Metrics: len 192, priority 8, table 0, ifidx 1, pid: 96365, seq 692004841, errno 0 flags:<UP,GATEWAY,DONE,STATIC> fmask: use: 4 mtu: 0 expire: 0 locks: inits: sockaddrs: <DST,GATEWAY,NETMASK,IFP,IFA> 0.0.0.0 172.31.1.1 0.0.0.0 96:00:00:34:06:8e 95.217.7.62 got message of size 192 on Fri Oct 25 12:00:11 2019 RTM_GET: Report Metrics: len 192, priority 8, table 0, ifidx 1, pid: 96365, seq 48078635, errno 0 flags:<UP,GATEWAY,DONE,STATIC> fmask: use: 4 mtu: 0 expire: 0 locks: inits: sockaddrs: <DST,GATEWAY,NETMASK,IFP,IFA> 0.0.0.0 172.31.1.1 0.0.0.0 96:00:00:34:06:8e 95.217.7.62 got message of size 168 on Fri Oct 25 12:00:12 2019 RTM_IFINFO: iface status change: len 168, if# 1, name: vio0, link: active, mtu: 1500, flags:<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,INET6_NOSOII> got message of size 192 on Fri Oct 25 12:00:12 2019 RTM_GET: Report Metrics: len 192, priority 8, table 0, ifidx 1, pid: 96365, seq 1167225572, errno 0 flags:<UP,GATEWAY,DONE,STATIC> fmask: use: 6 mtu: 0 expire: 0 locks: inits: sockaddrs: <DST,GATEWAY,NETMASK,IFP,IFA> 0.0.0.0 172.31.1.1 0.0.0.0 96:00:00:34:06:8e 95.217.7.62 -- Lauri Tirkkonen | lotheac @ IRCnet