diff options
author | Dmitry Kozlov <xeb@mail.ru> | 2013-10-11 16:53:14 +0400 |
---|---|---|
committer | Dmitry Kozlov <xeb@mail.ru> | 2013-10-11 16:53:22 +0400 |
commit | 67ac2ba78573644d6649921bafc41ba098061e0a (patch) | |
tree | f00d5c088656ff89fbccb82df59f5eba935782a4 /accel-pppd | |
parent | 8c608ea9a5b6b73520c11e3974bb8cad3b7da914 (diff) | |
download | accel-ppp-67ac2ba78573644d6649921bafc41ba098061e0a.tar.gz accel-ppp-67ac2ba78573644d6649921bafc41ba098061e0a.zip |
radius,ippool,chap-secrets: do not assign local address if session is not ppp
Do not assign local address for non-PPP (IPoE at present) sessions in
specified modules.
This enforces ctrl to assign proper local address by itself.
Signed-off-by: Dmitry Kozlov <xeb@mail.ru>
Diffstat (limited to 'accel-pppd')
-rw-r--r-- | accel-pppd/extra/chap-secrets.c | 5 | ||||
-rw-r--r-- | accel-pppd/extra/ippool.c | 5 | ||||
-rw-r--r-- | accel-pppd/radius/radius.c | 2 |
3 files changed, 10 insertions, 2 deletions
diff --git a/accel-pppd/extra/chap-secrets.c b/accel-pppd/extra/chap-secrets.c index 94e441d..d2d752a 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 8dbf027..442024c 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 b7fec28..30a8f80 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: |