summaryrefslogtreecommitdiff
path: root/src/libsystemd-network
diff options
context:
space:
mode:
authorJason Reeder <jasonreeder@gmail.com>2017-03-31 14:23:10 -0500
committerJason Reeder <jasonreeder@gmail.com>2017-03-31 15:29:00 -0500
commit5e25a13a05b2a3844295ca4a2a7e0f12de203ccb (patch)
tree869687291a090397b47de63bd8b302a917489836 /src/libsystemd-network
parent765a00b98d9176aeafc8a677a0e426edd2a20aab (diff)
libsystemd-network: sd-ipv4ll: Wrapper to restart address aquisition after conflict
After an ipv4ll claimed address conflict occurs a new address needs to be chosen and then the acquisition state machine needs to be restarted. This commit adds a function (sd_ipv4ll_restart) that clears the previously acquired address (ll->address) and then calls the existing sd_ipv4ll_start function to choose the new address and start the acquisition. Signed-off-by: Jason Reeder <jasonreeder@gmail.com>
Diffstat (limited to 'src/libsystemd-network')
-rw-r--r--src/libsystemd-network/sd-ipv4ll.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libsystemd-network/sd-ipv4ll.c b/src/libsystemd-network/sd-ipv4ll.c
index 13209261f9..88a90e593b 100644
--- a/src/libsystemd-network/sd-ipv4ll.c
+++ b/src/libsystemd-network/sd-ipv4ll.c
@@ -248,6 +248,12 @@ static int ipv4ll_pick_address(sd_ipv4ll *ll) {
return sd_ipv4ll_set_address(ll, &(struct in_addr) { addr });
}
+int sd_ipv4ll_restart(sd_ipv4ll *ll) {
+ ll->address = 0;
+
+ return sd_ipv4ll_start(ll);
+}
+
#define MAC_HASH_KEY SD_ID128_MAKE(df,04,22,98,3f,ad,14,52,f9,87,2e,d1,9c,70,e2,f2)
int sd_ipv4ll_start(sd_ipv4ll *ll) {