mirror of
http://thekelleys.org.uk/git/dnsmasq.git
synced 2026-12-05 22:18:35 +00:00
Ensure next_uid() can never return 0.
This commit is contained in:
1 parent
3f7483e816
commit
d5082158ee
1 file changed
+4
-2
+4
-2
@@ -74,13 +74,15 @@ static void cache_hash(struct crec *crecp);
|
|||||||
|
|
||||||
static unsigned int next_uid(void)
|
static unsigned int next_uid(void)
|
||||||
{
|
{
|
||||||
static unsigned int uid = 1;
|
static unsigned int uid = 0;
|
||||||
|
|
||||||
|
uid++;
|
||||||
|
|
||||||
/* uid == 0 used to indicate CNAME to interface name. */
|
/* uid == 0 used to indicate CNAME to interface name. */
|
||||||
if (uid == 0)
|
if (uid == 0)
|
||||||
uid++;
|
uid++;
|
||||||
|
|
||||||
return uid++;
|
return uid;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cache_init(void)
|
void cache_init(void)
|
||||||
|
|||||||
Reference in new issue
Block a user