Bug #7145
closedrc.newwanipv6 running in all cases, even for a renew
0%
Description
dhcp6c calls its script for every action, a new binding or a renew and so on. The problem is that rc.newwanipv6 is run even when nothing changed. For example, the address didn't get removed or changed, it just renews the lease and keeps on going. In this case, the interface wasn't altered at all and the actions it takes can be quite harsh/disruptive.
We may not be able to do anything about this yet since dhcp6c does not pass back the type of action it performed. It always sets REASON=NBI in the environment so the script can't tell what exactly happened. rc.newwanipv6 does check the old address vs the new, but it still does things like reset the routing and resets the monitor IP address routing.
It also appears to be triggered twice for each event. I added a "source" parameter to the dhcp6c_wan_script.sh:
Jan 19 10:22:04 clara php-fpm[298]: /rc.newwanipv6: rc.newwanipv6: Info: starting on vmx0, called by dhcp6c. Jan 19 10:22:04 clara php-fpm[298]: /rc.newwanipv6: rc.newwanipv6: on (IP address: 2001:db8::ffff:f236) (interface: wan) (real interface: vmx0). Jan 19 10:22:07 clara php-fpm[298]: /rc.newwanipv6: ROUTING: setting default route to 198.51.100.1 Jan 19 10:22:07 clara php-fpm[298]: /rc.newwanipv6: ROUTING: setting IPv6 default route to fe80::290:bff:fe37:a324%vmx0 Jan 19 10:22:07 clara php-fpm[298]: /rc.newwanipv6: Removing static route for monitor fe80::290:bff:fe37:a324 and adding a new route through fe80::290:bff:fe37:a324%vmx0 Jan 19 10:22:07 clara check_reload_status: Reloading filter Jan 19 10:22:07 clara php-fpm[299]: /rc.newwanipv6: rc.newwanipv6: Info: starting on vmx0, called by dhcp6c. Jan 19 10:22:07 clara php-fpm[299]: /rc.newwanipv6: rc.newwanipv6: on (IP address: 2001:db8::ffff:f236) (interface: wan) (real interface: vmx0). Jan 19 10:22:10 clara php-fpm[299]: /rc.newwanipv6: ROUTING: setting default route to 198.51.100.1 Jan 19 10:22:10 clara php-fpm[299]: /rc.newwanipv6: ROUTING: setting IPv6 default route to fe80::290:bff:fe37:a324%vmx0 Jan 19 10:22:10 clara php-fpm[299]: /rc.newwanipv6: Removing static route for monitor fe80::290:bff:fe37:a324 and adding a new route through fe80::290:bff:fe37:a324%vmx0 Jan 19 10:22:10 clara check_reload_status: Reloading filter
Feel free to kick this forward to 2.4.1 if there is no immediately viable solution
Files