aboutsummaryrefslogtreecommitdiffstats
path: root/src/radius
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2008-06-05 20:33:33 +0300
committerJouni Malinen <j@w1.fi>2008-06-05 20:33:33 +0300
commit815c5e1435fca7049fda7bd4b2dab2bdbc855062 (patch)
tree822fd39881491c9391040065c5336ec72ceef5b2 /src/radius
parentc5f5c91aeb3bee0e42f920318f6ded469fd1bb6a (diff)
downloadexternal_wpa_supplicant_8_ti-815c5e1435fca7049fda7bd4b2dab2bdbc855062.zip
external_wpa_supplicant_8_ti-815c5e1435fca7049fda7bd4b2dab2bdbc855062.tar.gz
external_wpa_supplicant_8_ti-815c5e1435fca7049fda7bd4b2dab2bdbc855062.tar.bz2
Fixed RADIUS client local address forcing for IPv6 (eapol_test)
Need to use the IPv6 address data in bind() call if IPv6 is selected.
Diffstat (limited to 'src/radius')
-rw-r--r--src/radius/radius_client.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/radius/radius_client.c b/src/radius/radius_client.c
index c299d7f..9728e72 100644
--- a/src/radius/radius_client.c
+++ b/src/radius/radius_client.c
@@ -742,7 +742,7 @@ radius_change_server(struct radius_client_data *radius,
#ifdef CONFIG_IPV6
struct sockaddr_in6 serv6, claddr6;
#endif /* CONFIG_IPV6 */
- struct sockaddr *addr;
+ struct sockaddr *addr, *cl_addr;
socklen_t addrlen, claddrlen;
char abuf[50];
int sel_sock;
@@ -824,6 +824,7 @@ radius_change_server(struct radius_client_data *radius,
claddr.sin_family = AF_INET;
claddr.sin_addr.s_addr = conf->client_addr.u.v4.s_addr;
claddr.sin_port = htons(0);
+ cl_addr = (struct sockaddr *) &claddr;
claddrlen = sizeof(claddr);
break;
#ifdef CONFIG_IPV6
@@ -833,6 +834,7 @@ radius_change_server(struct radius_client_data *radius,
os_memcpy(&claddr6.sin6_addr, &conf->client_addr.u.v6,
sizeof(struct in6_addr));
claddr6.sin6_port = htons(0);
+ cl_addr = (struct sockaddr *) &claddr6;
claddrlen = sizeof(claddr6);
break;
#endif /* CONFIG_IPV6 */
@@ -840,8 +842,7 @@ radius_change_server(struct radius_client_data *radius,
return -1;
}
- if (bind(sel_sock, (struct sockaddr *) &claddr, claddrlen) < 0)
- {
+ if (bind(sel_sock, cl_addr, claddrlen) < 0) {
perror("bind[radius]");
return -1;
}