From 57973b32094406f3bbdae0721d2d38b937914d4d Mon Sep 17 00:00:00 2001 From: Dmitriy Eshenko Date: Sat, 9 Mar 2024 18:16:43 +0300 Subject: ippool: use gw-ip-address for ppp even if mask setted --- accel-pppd/extra/ippool.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3