commit | d5082158ee55db893aeafb0f8392ae6b5e2d1354 | [log] [tgz] |
---|---|---|
author | Andy <andy.padavan@gmail.com> | Mon Mar 17 19:50:29 2014 +0000 |
committer | Simon Kelley <simon@thekelleys.org.uk> | Mon Mar 17 19:50:29 2014 +0000 |
tree | 2a70b9a55773369a2270c3c13f885c54646b9059 | |
parent | 3f7483e81684650102d8544ba1afd49be531bd54 [diff] |
Ensure next_uid() can never return 0.
diff --git a/src/cache.c b/src/cache.c index a7be5f1..a3f9c3a 100644 --- a/src/cache.c +++ b/src/cache.c
@@ -74,13 +74,15 @@ 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. */ if (uid == 0) uid++; - return uid++; + return uid; } void cache_init(void)