summaryrefslogtreecommitdiffstats
path: root/lib/libpam/modules
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2005-06-13 21:18:52 +0000
committerdes <des@FreeBSD.org>2005-06-13 21:18:52 +0000
commit2b425cf5e216be9701e947331dbc1227dbdad1d4 (patch)
tree8cb2a81d3e0ee289736cf3ff9028e88ccc14ae6b /lib/libpam/modules
parent4e4b8392b5645b9230a9ff0aa3e7c48adf22c67e (diff)
downloadFreeBSD-src-2b425cf5e216be9701e947331dbc1227dbdad1d4.zip
FreeBSD-src-2b425cf5e216be9701e947331dbc1227dbdad1d4.tar.gz
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
Diffstat (limited to 'lib/libpam/modules')
-rw-r--r--lib/libpam/modules/pam_radius/pam_radius.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libpam/modules/pam_radius/pam_radius.c b/lib/libpam/modules/pam_radius/pam_radius.c
index f6e1dc7..511baf3 100644
--- a/lib/libpam/modules/pam_radius/pam_radius.c
+++ b/lib/libpam/modules/pam_radius/pam_radius.c
@@ -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);
OpenPOWER on IntegriCloud