From d5082158ee55db893aeafb0f8392ae6b5e2d1354 Mon Sep 17 00:00:00 2001 From: Andy Date: Mon, 17 Mar 2014 19:50:29 +0000 Subject: Ensure next_uid() can never return 0. --- src/cache.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 void cache_hash(struct crec *crecp); 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) -- cgit v1.2.1