X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Flibsystemd-network%2Fsd-ipv4ll.c;h=fd39c12eb22df0c028fc1721001627e9a67ea697;hb=966bff2660a13c82b70a1e1ac4f1a48bb33d7f7e;hp=72289b2bafd492d6b2089430a9be84a40be46d77;hpb=4d978a46693e4f23bc73da6a0bafacfcff2aba05;p=elogind.git diff --git a/src/libsystemd-network/sd-ipv4ll.c b/src/libsystemd-network/sd-ipv4ll.c index 72289b2ba..fd39c12eb 100644 --- a/src/libsystemd-network/sd-ipv4ll.c +++ b/src/libsystemd-network/sd-ipv4ll.c @@ -382,7 +382,7 @@ static int ipv4ll_receive_message(sd_event_source *s, int fd, int sd_ipv4ll_set_index(sd_ipv4ll *ll, int interface_index) { assert_return(ll, -EINVAL); - assert_return(interface_index >= -1, -EINVAL); + assert_return(interface_index > 0, -EINVAL); assert_return(IN_SET(ll->state, IPV4LL_STATE_INIT, IPV4LL_STATE_STOPPED), -EBUSY); @@ -469,10 +469,13 @@ int sd_ipv4ll_get_address(sd_ipv4ll *ll, struct in_addr *address){ } int sd_ipv4ll_set_address_seed (sd_ipv4ll *ll, uint8_t seed[8]) { - unsigned int entropy = *seed; + unsigned int entropy; int r; assert_return(ll, -EINVAL); + assert_return(seed, -EINVAL); + + entropy = *seed; free(ll->random_data); free(ll->random_data_state);