If we encounter read errors reading the duid or iaid after successfully
opening the file, print an error and exit.
This commit is contained in:
parent
7b0db5b8d3
commit
745e9e8923
@ -175,6 +175,9 @@ void get_clientid(struct client_state_t *cs, struct client_config_t *cc)
|
|||||||
cc->interface, __func__);
|
cc->interface, __func__);
|
||||||
} else {
|
} else {
|
||||||
iaid_len = safe_read(fd, iaid, sizeof iaid);
|
iaid_len = safe_read(fd, iaid, sizeof iaid);
|
||||||
|
if (iaid_len < 0)
|
||||||
|
suicide("%s: (%s) failed to read IAID from file",
|
||||||
|
cc->interface, __func__);
|
||||||
}
|
}
|
||||||
close(fd);
|
close(fd);
|
||||||
|
|
||||||
@ -188,6 +191,9 @@ void get_clientid(struct client_state_t *cs, struct client_config_t *cc)
|
|||||||
cc->interface, __func__);
|
cc->interface, __func__);
|
||||||
} else {
|
} else {
|
||||||
duid_len = safe_read(fd, duid, sizeof duid);
|
duid_len = safe_read(fd, duid, sizeof duid);
|
||||||
|
if (duid_len < 0)
|
||||||
|
suicide("%s: (%s) failed to read DUID from file",
|
||||||
|
cc->interface, __func__);
|
||||||
}
|
}
|
||||||
close(fd);
|
close(fd);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user