diff options
author | Denys Fedoryshchenko <denys.f@collabora.com> | 2024-03-10 16:21:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-10 16:21:36 +0200 |
commit | 827431d1b60bbd0ce140394e888b73d05f095ff1 (patch) | |
tree | 5a58d334dba792a1434e4dd01ac8c9c094f5bf43 | |
parent | 19c36e593d9b74a0f95582b6343b0921cd31e32a (diff) | |
parent | 57973b32094406f3bbdae0721d2d38b937914d4d (diff) | |
download | accel-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.c | 12 |
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 |