Don't use a cast as an lvalue.

Add a redundant test to make it painfully obvious to the reader that this
code does not support IPv6.

Approved by:	re (dwhite)
MFC after:	1 week
This commit is contained in:
Dag-Erling Smørgrav 2005-06-13 21:18:52 +00:00
parent bc031652cb
commit 30d0a60aed
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=147350

View File

@ -108,10 +108,10 @@ build_access_request(struct rad_handle *radh, const char *user,
}
if (nas_ipaddr != NULL) {
memset(&hints, 0, sizeof(hints));
hints.ai_family = PF_INET;
hints.ai_family = AF_INET;
if (getaddrinfo(nas_ipaddr, NULL, &hints, &res) == 0 &&
res != NULL) {
(struct sockaddr *)haddr = res->ai_addr;
res != NULL && res->ai_family == AF_INET) {
haddr = (struct sockaddr_in *)res->ai_addr;
error = rad_put_addr(radh, RAD_NAS_IP_ADDRESS,
haddr->sin_addr);
freeaddrinfo(res);