summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Fedoryshchenko <denys.f@collabora.com>2024-03-10 16:21:36 +0200
committerGitHub <noreply@github.com>2024-03-10 16:21:36 +0200
commit827431d1b60bbd0ce140394e888b73d05f095ff1 (patch)
tree5a58d334dba792a1434e4dd01ac8c9c094f5bf43
parent19c36e593d9b74a0f95582b6343b0921cd31e32a (diff)
parent57973b32094406f3bbdae0721d2d38b937914d4d (diff)
downloadaccel-ppp-827431d1b60bbd0ce140394e888b73d05f095ff1.tar.gz
accel-ppp-827431d1b60bbd0ce140394e888b73d05f095ff1.zip
Merge pull request #121 from DmitriyEshenko/ippool-gw-fix
ippool: use gw-ip-address for ppp even if mask setted
-rw-r--r--accel-pppd/extra/ippool.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/accel-pppd/extra/ippool.c b/accel-pppd/extra/ippool.c
index 7a91cf4..6ba2b5d 100644
--- a/accel-pppd/extra/ippool.c
+++ b/accel-pppd/extra/ippool.c
@@ -100,10 +100,20 @@ struct ippool_t *find_pool(char *name, int create)
static void parse_gw_ip_address(const char *val)
{
+ char addr[17];
+ char *ptr;
+
if (!val)
return;
- conf_gw_ip_address = inet_addr(val);
+ ptr = strchr(val, '/');
+ if (ptr) {
+ memcpy(addr, val, ptr - val);
+ addr[ptr - val] = 0;
+ conf_gw_ip_address = inet_addr(addr);
+ }
+ else
+ conf_gw_ip_address = inet_addr(val);
}
//parses ranges like x.x.x.x/mask