diff options
author | DmitriyEshenko <dmitriy.eshenko@vyos.io> | 2020-05-25 15:42:09 +0000 |
---|---|---|
committer | DmitriyEshenko <dmitriy.eshenko@vyos.io> | 2020-05-25 15:42:09 +0000 |
commit | 488621e38b798d4d633180eb430f7cb3ee787a07 (patch) | |
tree | 27f4e92e95d16a55b3ec4337d39dd695526ac4de /src | |
parent | e6e5c1af1e8c741832e7ea4be477c2117203501d (diff) | |
download | libpam-radius-auth-488621e38b798d4d633180eb430f7cb3ee787a07.tar.gz libpam-radius-auth-488621e38b798d4d633180eb430f7cb3ee787a07.zip |
login-radius: T2478: Use source-address as NAS-IP-Address if defined
Diffstat (limited to 'src')
-rw-r--r-- | src/pam_radius_auth.c | 6 |
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) { |