diff options
author | Dmitry Kozlov <xeb@mail.ru> | 2021-08-26 12:56:02 +0300 |
---|---|---|
committer | Dmitry Kozlov <xeb@mail.ru> | 2021-08-26 12:56:02 +0300 |
commit | 5daf0f6782b769600855f745aa0a2e514a06a8aa (patch) | |
tree | c386bac3188c0825393a290393eaf68616fdacba /accel-pppd/ctrl | |
parent | a77f448266e90d6706517cb91a699be080268eb3 (diff) | |
parent | 2224396d8d184e2c267a9958408e0606541e9d0b (diff) | |
download | accel-ppp-5daf0f6782b769600855f745aa0a2e514a06a8aa.tar.gz accel-ppp-5daf0f6782b769600855f745aa0a2e514a06a8aa.zip |
Merge branch 'master' of github.com:accel-ppp/accel-ppp
Diffstat (limited to 'accel-pppd/ctrl')
-rw-r--r-- | accel-pppd/ctrl/ipoe/dhcpv4.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/accel-pppd/ctrl/ipoe/dhcpv4.c b/accel-pppd/ctrl/ipoe/dhcpv4.c index ffbbcfe..f1d9c46 100644 --- a/accel-pppd/ctrl/ipoe/dhcpv4.c +++ b/accel-pppd/ctrl/ipoe/dhcpv4.c @@ -105,7 +105,7 @@ static struct dhcpv4_iprange *parse_range(const char *str) pthread_mutex_init(&r->lock, NULL); end -= start; - r->free[(end - 1) / ( 8 * sizeof(long))] &= (1l << ((end - 1) % (8 * sizeof(long)) + 1)) - 1; + r->free[(end - 1) / ( 8 * sizeof(long))] &= (1ul << ((end - 1) % (8 * sizeof(long)) + 1)) - 1; r->free[0] &= ~3; return r; @@ -1179,7 +1179,7 @@ int dhcpv4_get_ip(struct dhcpv4_serv *serv, uint32_t *yiaddr, uint32_t *siaddr, for (i = serv->range->pos; i < serv->range->len; i++) { k = ffsl(serv->range->free[i]); if (k) { - serv->range->free[i] &= ~(1l << (k - 1)); + serv->range->free[i] &= ~(1lu << (k - 1)); serv->range->pos = i; pthread_mutex_unlock(&serv->range->lock); *yiaddr = htonl(serv->range->startip + i * 8 * sizeof(long) + k - 1); @@ -1207,7 +1207,7 @@ void dhcpv4_put_ip(struct dhcpv4_serv *serv, uint32_t ip) return; pthread_mutex_lock(&serv->range->lock); - serv->range->free[n / (8 * sizeof(long))] |= 1l << (n % (8 * sizeof(long))); + serv->range->free[n / (8 * sizeof(long))] |= 1lu << (n % (8 * sizeof(long))); pthread_mutex_unlock(&serv->range->lock); } |