Commit d5082158 authored by Andy's avatar Andy Committed by Simon Kelley

Ensure next_uid() can never return 0.

parent 3f7483e8
...@@ -74,13 +74,15 @@ static void cache_hash(struct crec *crecp); ...@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment