xcp-networkd must stop and start the dhclient for the interface
if default gateway has changed.
Example:
1) If default gateway is xenbr0 - Its conf file will keep this
gateway information.
2) Switch the default gateway to xenbr1 - Its conf file will be
created with gateway information.
3) Switch the default gateway back to xenbr0 then dhclient won't
get restarted.
Reason:
1) While switching default gateway from xenbr0 to xenbr1,
gateway information from xenbr0 conf file was not removed.
2) On switching default gateway from xenbr1 to xenbr0, xcp-networkd
found no diff in conf file hence not retarted the dhclient for xenbr0.
It resulted default gateway still pointed to xenbr1.
xcp-networkd must stop and start the dhclient for the interface if default gateway has changed.
Example: 1) If default gateway is xenbr0 - Its conf file will keep this gateway information. 2) Switch the default gateway to xenbr1 - Its conf file will be created with gateway information. 3) Switch the default gateway back to xenbr0 then dhclient won't get restarted.
Reason: 1) While switching default gateway from xenbr0 to xenbr1, gateway information from xenbr0 conf file was not removed. 2) On switching default gateway from xenbr1 to xenbr0, xcp-networkd found no diff in conf file hence not retarted the dhclient for xenbr0.
It resulted default gateway still pointed to xenbr1.
Signed-off-by: sharad yadav sharad.yadav@citrix.com