netinet{,6}: Assert in{,6}_inithead() are only used for system routing tables. master
authorNuno Antunes <nuno.antunes@gmail.com>
Wed, 19 Aug 2015 07:46:07 +0000 (15:46 +0800)
committerNuno Antunes <nuno.antunes@gmail.com>
Thu, 20 Aug 2015 04:45:11 +0000 (12:45 +0800)
Suggested-by: sephe
sys/netinet/in_rmx.c
sys/netinet6/in6_rmx.c

index df0c780..9bf2b7e 100644 (file)
@@ -437,6 +437,8 @@ in_inithead(void **head, int off)
        struct in_rtqtimo_ctx *ctx;
        int cpuid = mycpuid;
 
+       KKASSERT(head == (void **)&rt_tables[cpuid][AF_INET]);
+
        if (!rn_inithead(head, rn_cpumaskhead(cpuid), off))
                return 0;
 
index ce35442..0eb4350 100644 (file)
@@ -517,6 +517,8 @@ in6_inithead(void **head, int off)
        struct in6_rttimo_ctx *ctx;
        int cpuid = mycpuid;
 
+       KKASSERT(head == (void **)&rt_tables[cpuid][AF_INET6]);
+
        if (!rn_inithead(head, rn_cpumaskhead(cpuid), off))
                return 0;