diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ipv4.c | 2 | ||||
-rw-r--r-- | lib/lists.h | 3 | ||||
-rw-r--r-- | lib/resource.c | 2 |
3 files changed, 4 insertions, 3 deletions
@@ -60,7 +60,7 @@ ipv4_class_mask(u32 a) if (a < 0x80000000) m = 0xff000000; - if (a < 0xc0000000) + else if (a < 0xc0000000) m = 0xffff0000; else m = 0xffffff00; diff --git a/lib/lists.h b/lib/lists.h index 6fab12c4..0b0fdbe3 100644 --- a/lib/lists.h +++ b/lib/lists.h @@ -34,7 +34,8 @@ typedef struct list { /* In fact two overlayed nodes */ #define HEAD(list) ((void *)((list).head)) #define TAIL(list) ((void *)((list).tail)) #define NODE_NEXT(n) ((void *)((NODE (n))->next)) -#define WALK_LIST(n,list) for(n=HEAD(list);(NODE (n))->next; n=NODE_NEXT(n)) +#define NODE_VALID(n) ((NODE (n))->next) +#define WALK_LIST(n,list) for(n=HEAD(list); NODE_VALID(n); n=NODE_NEXT(n)) #define WALK_LIST_DELSAFE(n,nxt,list) \ for(n=HEAD(list); nxt=NODE_NEXT(n); n=(void *) nxt) /* WALK_LIST_FIRST supposes that called code removes each processed node */ diff --git a/lib/resource.c b/lib/resource.c index 24164ec2..42243aa2 100644 --- a/lib/resource.c +++ b/lib/resource.c @@ -352,7 +352,7 @@ mb_alloc(pool *p, unsigned size) * zeroes and creates a memory block resource representing this memory * chunk in the pool @p. * - * Please note that mb_alloc() returns a pointer to the memory + * Please note that mb_allocz() returns a pointer to the memory * chunk, not to the resource, hence you have to free it using * mb_free(), not rfree(). */ |