summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/pam_radius_auth.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/pam_radius_auth.c b/src/pam_radius_auth.c
index 7f29f37..31db395 100644
--- a/src/pam_radius_auth.c
+++ b/src/pam_radius_auth.c
@@ -993,7 +993,11 @@ static void build_radius_packet(AUTH_HDR * request, CONST char *user,
}
/* Perhaps add NAS IP Address (and v6 version) */
- add_nas_ip_address(request, hostname);
+ /* Add possibility use source-ip-address as NAS-IP-Address */
+ if (conf->server->src_ip && strlen(conf->server->src_ip) > 0)
+ add_nas_ip_address(request, conf->server->src_ip);
+ else
+ add_nas_ip_address(request, hostname);
/* There's always a NAS identifier */
if (conf->client_id && *conf->client_id) {