From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Tremer To: network@lists.ipfire.org Subject: Re: [PATCH] dhclient-script: fix bound Date: Thu, 07 Sep 2017 20:46:27 +0100 Message-ID: <1504813587.18494.16.camel@ipfire.org> In-Reply-To: <1503926835-2098-1-git-send-email-jonatan.schlag@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6456373421786889468==" List-Id: --===============6456373421786889468== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Thanks for investigating this one. It was a tough one. Great work! -Michael On Mon, 2017-08-28 at 15:27 +0200, Jonatan Schlag wrote: > When we get a BOUND we should have only new_* variables set. > So it is stated in the manpage. > Apparently, also old_* variables are set so we never got into the block whe= re > the IP address was set. > We now always set a new IP Address when we get a BOUND. >=20 > Fixes: #11363 >=20 > Signed-off-by: Jonatan Schlag > --- > src/dhclient-script | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) >=20 > diff --git a/src/dhclient-script b/src/dhclient-script > index c2e0678..ec990bf 100644 > --- a/src/dhclient-script > +++ b/src/dhclient-script > @@ -197,7 +197,8 @@ case "${reason}" in > =20 > BOUND|RENEW|REBIND|REBOOT) > # Check if the IP address has changed. If so, delete all > routes and stuff. > - if [ -n "${old_ip_address}" -a "${old_ip_address}" !=3D > "${new_ip_address}" ]; then > + if [ -n "${old_ip_address}" -a "${old_ip_address}" !=3D > "${new_ip_address}" ] || \ > + [ "${reason}" =3D "BOUND" ]; then > ipv4_flush_device ${interface} > fi > =20 > @@ -208,7 +209,8 @@ case "${reason}" in > [ ! "${old_network_number}" =3D > "${new_network_number}" ] || \ > [ ! "${old_broadcast_address}" =3D > "${new_broadcast_address}" ] || \ > [ ! "${old_routers}" =3D > "${new_routers}" ] || \ > - [ ! "${old_interface_mtu}" =3D > "${new_interface_mtu}" ]; then > + [ ! "${old_interface_mtu}" =3D > "${new_interface_mtu}" ] || \ > + [ "${reason}" =3D "BOUND" ]; then > =20 > =20 > # Calc the prefix from the subnet > mask --===============6456373421786889468== Content-Type: application/pgp-signature Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="signature.asc" MIME-Version: 1.0 LS0tLS1CRUdJTiBQR1AgU0lHTkFUVVJFLS0tLS0KCmlRSXpCQUFCQ2dBZEZpRUU1L3JXNWwzR0dl Mnlwa3R4Z0hudy8yK1FDUWNGQWxteG9oTUFDZ2tRZ0hudy8yK1EKQ1FlaktnLzhESlBpcDVsVHlH aVJ3T2VSaThhaGJOSSs0UVdxM1Y1di80dkZLYVFvRnZMZGp1OW5TZVNkSy9WbgpzQWRvMlNXRytx aVAxYXFSN1hla1B6QndadHYzT3Y4Rld1R1RvL29lMVJWZncyclk1N0pzcGUxejdaNFN1TkxmCnp6 RElkazVBWlplZ3kzNGtjRWE0amt5TktYak5MOWZCOHVETTdXb056V3dwUGNsWlplTm5WMEZjMWxV NnZta1MKVHo4QTlHZHFyay9hSlp1S0hsTlBRblkyMFVZTUJqZ2JQUC9UWS9lYXk3ODFNbmxpR2RO Rmw4amJna3A3S2hLRgoydlUwZllXTTBGdm10L3NOSTRWUSttTzJ2Mk9TbHV2N0gvSmw5b1FuTGxl ZE5CYkIzUHhub2lGbFowSXlsMU9rCnB6RWhSbFFkK3Y4RmF1eTM3M0pyd284SHhSdWRMN09SNlhI YTNBeTVMdExMRVB1Rmt4dHYyOFRuQ2tOVGlhVXMKMWl4RmUwNlVnTUxleXErbFBKNzhTaDg0V2dG OXYxM2FZK0dJbFFBcHJCZklhcUZvOVBxaHZxWGsyMW5LcFA3KwpXY0wvTDBvUERwVmRxVWtyNklk d3AvY2t6dVBuS1dyRXJpQXJYNUF0K1ErbjNPZU5WSFc3Yk82MXJOTXRBVTU5CmdCSVcrNXQ2UzBP UDVCOGZKQnFRekJiNmZzekdKc3hsbWFCYTVES2tLdGVKMEFZUDYxSVdrWUhqa0RONGNBR3cKWisz dG8rYy9RcFRFckxscVFuMnFjOHBnV09YcFNhWEdQblY1UkxnZEZ2OUJlZUtKdGpjRVVmeFRMeWV3 d0MrWApTeUF5dkVDcUN2ZE5yUXFzOUlnb3NnZ0dLcHRLanMvbXhGTjN4NVowUWZlVTRYUXllMnM9 Cj1XQ0pMCi0tLS0tRU5EIFBHUCBTSUdOQVRVUkUtLS0tLQo= --===============6456373421786889468==--