View | Details | Raw Unified | Return to bug 256714 | Differences between
and this patch

Collapse All | Expand All

(-)b/sys/net/pfil.c (+1 lines)
Lines 251-256 pfil_head_unregister(pfil_head_t ph) Link Here
251
		link->link_hook->hook_links--;
251
		link->link_hook->hook_links--;
252
		free(link, M_PFIL);
252
		free(link, M_PFIL);
253
	}
253
	}
254
	free(ph, M_PFIL);
254
	PFIL_UNLOCK();
255
	PFIL_UNLOCK();
255
}
256
}
256
257
(-)b/sys/netinet6/in6.c (-3 / +5 lines)
Lines 1376-1384 in6_purgeifaddr(struct in6_ifaddr *ia) Link Here
1376
	pr = ia->ia6_ndpr;
1376
	pr = ia->ia6_ndpr;
1377
	in6_purgeaddr(&ia->ia_ifa);
1377
	in6_purgeaddr(&ia->ia_ifa);
1378
	if (pr != NULL && pr->ndpr_addrcnt == 0) {
1378
	if (pr != NULL && pr->ndpr_addrcnt == 0) {
1379
		ND6_WLOCK();
1379
		if (pr->ndpr_refcnt == 1) {:
1380
		nd6_prefix_unlink(pr, NULL);
1380
			ND6_WLOCK();
1381
		ND6_WUNLOCK();
1381
			nd6_prefix_unlink(pr, NULL);
1382
			ND6_WUNLOCK();
1383
		}
1382
		nd6_prefix_del(pr);
1384
		nd6_prefix_del(pr);
1383
	}
1385
	}
1384
}
1386
}
(-)b/sys/netinet6/in6_fib_algo.c (+33 lines)
Lines 156-164 static void Link Here
156
lradix6_destroy(void *_data)
156
lradix6_destroy(void *_data)
157
{
157
{
158
	struct lradix6_data *lr = (struct lradix6_data *)_data;
158
	struct lradix6_data *lr = (struct lradix6_data *)_data;
159
	int i, j, k;
160
	struct radix6_addr_entry *ae;
161
	/* 2 records per addr entry */
162
	size_t max_items = lr->num_items * 2;
159
163
160
	if (lr->rnh != NULL)
164
	if (lr->rnh != NULL)
161
		rn_detachhead((void **)&lr->rnh);
165
		rn_detachhead((void **)&lr->rnh);
166
167
	/* rn_detachhead doesn't clean up all the rn_mklist entries properly.
168
	 * Since we know we're done, we can do a second pass here on the flat
169
	 * array of nodes to free any pointers when we see them for the first time.
170
	 */
171
	struct radix_mask **mask_list = malloc(max_items * sizeof(void *), M_RTABLE, 0);
172
	memset(mask_list, 0, max_items * sizeof(void *));
173
	int cur_entry = 0;
174
	for (i = 0; i < lr->num_items; i++) {
175
		ae = (struct radix6_addr_entry *)((char *)lr->radix_mem +
176
		    (i * LRADIX6_ITEM_SZ));
177
		for (j = 0; j < 2; j++) {
178
			if (ae->rn[j].rn_mklist != NULL) {
179
				bool found = false;
180
				for (k = 0; k < cur_entry; k++) {
181
					if (ae->rn[j].rn_mklist == mask_list[k]) {
182
						found = true;
183
						break;
184
					}
185
				}
186
				if (!found) {
187
					free(ae->rn[j].rn_mklist, M_RTABLE);
188
					mask_list[cur_entry++] = ae->rn[j].rn_mklist;
189
				}
190
			}
191
		}
192
	}
193
	free(mask_list, M_RTABLE);
194
162
	if (lr->mem != NULL)
195
	if (lr->mem != NULL)
163
		free(lr->mem, M_RTABLE);
196
		free(lr->mem, M_RTABLE);
164
	free(lr, M_RTABLE);
197
	free(lr, M_RTABLE);

Return to bug 256714