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_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);
(-)b/sys/netinet6/in6_ifattach.c (-2 / +2 lines)
Lines 525-532 in6_ifattach_linklocal(struct ifnet *ifp, struct ifnet *altifp) Link Here
525
		/* Reference prefix */
525
		/* Reference prefix */
526
		ia->ia6_ndpr = pr;
526
		ia->ia6_ndpr = pr;
527
		pr->ndpr_addrcnt++;
527
		pr->ndpr_addrcnt++;
528
	} else
528
	}
529
		nd6_prefix_rele(pr);
529
	nd6_prefix_rele(pr);
530
530
531
	return 0;
531
	return 0;
532
}
532
}

Return to bug 256714