summaryrefslogtreecommitdiff
path: root/accel-pppd
diff options
context:
space:
mode:
Diffstat (limited to 'accel-pppd')
-rw-r--r--accel-pppd/extra/chap-secrets.c5
-rw-r--r--accel-pppd/extra/ippool.c5
-rw-r--r--accel-pppd/radius/radius.c2
3 files changed, 10 insertions, 2 deletions
diff --git a/accel-pppd/extra/chap-secrets.c b/accel-pppd/extra/chap-secrets.c
index 94e441de..d2d752a2 100644
--- a/accel-pppd/extra/chap-secrets.c
+++ b/accel-pppd/extra/chap-secrets.c
@@ -287,7 +287,7 @@ static struct ipv4db_item_t *get_ip(struct ap_session *ses)
{
struct cs_pd_t *pd;
- if (!conf_gw_ip_address)
+ if (!conf_gw_ip_address && ses->ctrl->ppp)
return NULL;
pd = find_pd(ses);
@@ -298,6 +298,9 @@ static struct ipv4db_item_t *get_ip(struct ap_session *ses)
if (!pd->ip.peer_addr)
return NULL;
+ if (!ses->ctrl->ppp)
+ pd->ip.addr = 0;
+
return &pd->ip;
}
diff --git a/accel-pppd/extra/ippool.c b/accel-pppd/extra/ippool.c
index 8dbf0272..442024c6 100644
--- a/accel-pppd/extra/ippool.c
+++ b/accel-pppd/extra/ippool.c
@@ -285,6 +285,11 @@ static struct ipv4db_item_t *get_ip(struct ap_session *ses)
it = NULL;
spin_unlock(&p->lock);
+ if (ses->ctrl->ppp)
+ it->it.addr = conf_gw_ip_address;
+ else
+ it->it.addr = 0;
+
return it ? &it->it : NULL;
}
diff --git a/accel-pppd/radius/radius.c b/accel-pppd/radius/radius.c
index b7fec28e..30a8f80a 100644
--- a/accel-pppd/radius/radius.c
+++ b/accel-pppd/radius/radius.c
@@ -96,7 +96,7 @@ int rad_proc_attrs(struct rad_req_t *req)
else if (attr->val.ipaddr != 0xfffffffe) {
req->rpd->ipv4_addr.owner = &ipdb;
req->rpd->ipv4_addr.peer_addr = attr->val.ipaddr;
- req->rpd->ipv4_addr.addr = conf_gw_ip_address;
+ req->rpd->ipv4_addr.addr = req->rpd->ses->ctrl->ppp ? conf_gw_ip_address : 0;
}
break;
case Acct_Interim_Interval: