summaryrefslogtreecommitdiff
path: root/accel-pppd/ppp
diff options
context:
space:
mode:
authorGuillaume Nault <g.nault@alphalink.fr>2018-11-07 19:28:57 +0100
committerDmitry Kozlov <xeb@mail.ru>2018-11-12 17:00:37 +0300
commit1c40018e238dc27c9428631cf71633f218bd7824 (patch)
tree65da9c4b618f1e3c01ae5e76ce911891258c17ca /accel-pppd/ppp
parent29b90105499d03957a63c0efb22a7852b2b1faa1 (diff)
downloadaccel-ppp-1c40018e238dc27c9428631cf71633f218bd7824.tar.gz
accel-ppp-1c40018e238dc27c9428631cf71633f218bd7824.zip
ipcp: reject *-DNS-Address if we have no value to propose
If dns_opt->addr is NULL, then we have no address to propose (none defined in accel-ppp.conf and none provided by RADIUS). Currently, in that case, accel-ppp accepts and acks the address found in the peer's configuration request. But the peer would normally use the undefined IP address, so if we ack it, we explicitely tell the peer that 0.0.0.0 is the primary/secondary DNS server. If the peer already knows a DNS server IP address, it doesn't have to negociate it with accel-ppp. It can just use it directly, after it retrieved its own IP address. Therefore there is no need for accel-ppp to blindly accept addresses proposed by the peer. This patch rejects *-DNS-Address if accel-ppp has no DNS server to propose, making it explicit to the peer that its request can't be satisfied. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
Diffstat (limited to 'accel-pppd/ppp')
-rw-r--r--accel-pppd/ppp/ipcp_opt_dns.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/accel-pppd/ppp/ipcp_opt_dns.c b/accel-pppd/ppp/ipcp_opt_dns.c
index 56160fe..dec96e3 100644
--- a/accel-pppd/ppp/ipcp_opt_dns.c
+++ b/accel-pppd/ppp/ipcp_opt_dns.c
@@ -102,10 +102,8 @@ static int dns_recv_conf_req(struct ppp_ipcp_t *ipcp, struct ipcp_option_t *opt,
if (opt32->hdr.len != 6)
return IPCP_OPT_REJ;
- if (!dns_opt->addr) {
- dns_opt->addr = opt32->val;
- return IPCP_OPT_ACK;
- }
+ if (!dns_opt->addr)
+ return IPCP_OPT_REJ;
if (dns_opt->addr == opt32->val)
return IPCP_OPT_ACK;