diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-05-26 17:05:37 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-26 17:05:37 +0200 |
commit | c805cd0d37baa8d9f7a900704b62ea37eb3d3fd0 (patch) | |
tree | 27f4e92e95d16a55b3ec4337d39dd695526ac4de | |
parent | e6e5c1af1e8c741832e7ea4be477c2117203501d (diff) | |
parent | 488621e38b798d4d633180eb430f7cb3ee787a07 (diff) | |
download | libpam-radius-auth-c805cd0d37baa8d9f7a900704b62ea37eb3d3fd0.tar.gz libpam-radius-auth-c805cd0d37baa8d9f7a900704b62ea37eb3d3fd0.zip |
Merge pull request #3 from DmitriyEshenko/fix001
login-radius: T2478: Use source-address as NAS-IP-Address if defined
-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) { |