summaryrefslogtreecommitdiff
path: root/accel-pptpd/radius
diff options
context:
space:
mode:
authorKozlov Dmitry <dima@server>2010-10-29 14:59:22 +0400
committerKozlov Dmitry <dima@server>2010-10-29 14:59:22 +0400
commit01da9860b5637448208cbe8f88bf7a9a290a4f3f (patch)
treef2e132fcf4365611d7a1ad84172e99c86de8d5c6 /accel-pptpd/radius
parent4e1a10190d4afba6a960666fa540a8983023b595 (diff)
downloadaccel-ppp-xebd-01da9860b5637448208cbe8f88bf7a9a290a4f3f.tar.gz
accel-ppp-xebd-01da9860b5637448208cbe8f88bf7a9a290a4f3f.zip
ppp: improved mppe handling
radius: bind parameter to bind to ip other then nas-ip-address
Diffstat (limited to 'accel-pptpd/radius')
-rw-r--r--accel-pptpd/radius/radius.c7
-rw-r--r--accel-pptpd/radius/radius_p.h1
-rw-r--r--accel-pptpd/radius/req.c4
3 files changed, 10 insertions, 2 deletions
diff --git a/accel-pptpd/radius/radius.c b/accel-pptpd/radius/radius.c
index a07df9a..e6a13e9 100644
--- a/accel-pptpd/radius/radius.c
+++ b/accel-pptpd/radius/radius.c
@@ -27,6 +27,7 @@ int conf_timeout = 3;
char *conf_nas_identifier = "accel-pptpd";
char *conf_nas_ip_address;
char *conf_gw_ip_address;
+in_addr_t conf_bind = 0;
int conf_verbose = 0;
char *conf_auth_server;
@@ -378,6 +379,12 @@ static void __init radius_init(void)
if (opt)
conf_gw_ip_address = opt;
+ opt = conf_get_opt("radius", "bind");
+ if (opt)
+ conf_bind = inet_addr(opt);
+ else if (conf_nas_ip_address)
+ conf_bind = inet_addr(conf_nas_ip_address);
+
opt = conf_get_opt("radius", "auth_server");
if (!opt) {
log_emerg("radius: auth_server not specified\n");
diff --git a/accel-pptpd/radius/radius_p.h b/accel-pptpd/radius/radius_p.h
index a24d687..efcd9b8 100644
--- a/accel-pptpd/radius/radius_p.h
+++ b/accel-pptpd/radius/radius_p.h
@@ -59,6 +59,7 @@ extern int conf_timeout;
extern int conf_verbose;
extern char *conf_nas_identifier;
extern char *conf_nas_ip_address;
+extern in_addr_t conf_bind;
extern char *conf_gw_ip_address;
extern char *conf_auth_server;
extern char *conf_auth_secret;
diff --git a/accel-pptpd/radius/req.c b/accel-pptpd/radius/req.c
index f92d122..7526a92 100644
--- a/accel-pptpd/radius/req.c
+++ b/accel-pptpd/radius/req.c
@@ -140,8 +140,8 @@ static int make_socket(struct rad_req_t *req)
memset(&addr, 0, sizeof(addr));
addr.sin_family = AF_INET;
- if (conf_nas_ip_address) {
- addr.sin_addr.s_addr = inet_addr(conf_nas_ip_address);
+ if (conf_bind) {
+ addr.sin_addr.s_addr = conf_bind;
if (bind(req->hnd.fd, (struct sockaddr *) &addr, sizeof(addr))) {
log_ppp_error("radius:bind: %s\n", strerror(errno));
goto out_err;