diff options
author | Kozlov Dmitry <dima@server> | 2010-11-09 12:38:22 +0300 |
---|---|---|
committer | Kozlov Dmitry <dima@server> | 2010-11-09 12:43:58 +0300 |
commit | d0130adf3aaca9fa3fee227a06f3e1cfcbf40784 (patch) | |
tree | 7936cf76dc66b6fbcc7d715ab75c061ebf34f3d3 | |
parent | 08344fe080a5557295b03c46262fc6f4d2845d7a (diff) | |
download | accel-ppp-d0130adf3aaca9fa3fee227a06f3e1cfcbf40784.tar.gz accel-ppp-d0130adf3aaca9fa3fee227a06f3e1cfcbf40784.zip |
radius: skip nas identification if no NAS-Identifier/NAS-IP-Address presents
-rw-r--r-- | accel-pptpd/radius/radius.c | 7 | ||||
-rw-r--r-- | accel-pptpd/radius/radius_p.h | 1 |
2 files changed, 7 insertions, 1 deletions
diff --git a/accel-pptpd/radius/radius.c b/accel-pptpd/radius/radius.c index ed9830bc..0a9f2da4 100644 --- a/accel-pptpd/radius/radius.c +++ b/accel-pptpd/radius/radius.c @@ -40,6 +40,7 @@ char *conf_acct_secret; char *conf_dm_coa_secret; int conf_sid_in_auth = 0; +int conf_require_nas_ident = 0; static LIST_HEAD(sessions); static pthread_rwlock_t sessions_lock = PTHREAD_RWLOCK_INITIALIZER; @@ -308,7 +309,7 @@ int rad_check_nas_pack(struct rad_packet_t *pack) ipaddr = attr->val.ipaddr; } - if (!ident && !ipaddr) + if (conf_require_nas_ident && !ident && !ipaddr) return -1; if (conf_nas_identifier && ident && strcmp(conf_nas_identifier, ident)) @@ -417,6 +418,10 @@ static void __init radius_init(void) if (opt && atoi(opt) > 0) conf_sid_in_auth = 1; + opt = conf_get_opt("radius", "require-nas-identification"); + if (opt && atoi(opt) > 0) + conf_require_nas_ident = 1; + if (rad_dict_load(dict)) _exit(EXIT_FAILURE); diff --git a/accel-pptpd/radius/radius_p.h b/accel-pptpd/radius/radius_p.h index 99db1455..984f4800 100644 --- a/accel-pptpd/radius/radius_p.h +++ b/accel-pptpd/radius/radius_p.h @@ -69,6 +69,7 @@ extern char *conf_acct_secret; extern int conf_acct_server_port; extern char *conf_dm_coa_secret; extern int conf_sid_in_auth; +extern int conf_require_nas_ident; int rad_check_nas_pack(struct rad_packet_t *pack); struct radius_pd_t *rad_find_session(const char *sessionid, const char *username, int port_id, in_addr_t ipaddr, const char *csid); |