/* The caller of this function should free the memory allocated for each linknamelist_t "entry" allocated.  */
static boolean_t list_interfaces(const char *, void *)
/* The caller of this function should free the memory allocated for each linknamelist_t "entry" allocated.  */
static boolean_t list_interfaces(const char *, void *)
{
	linkwalk_t	*lwp = arg;
	linknamelist_t	*entry;
	if ((entry = calloc(1, sizeof(linknamelist_t))) == NULL) {
		lwp->lw_err = ENOMEM;
		return (B_TRUE);
	}
	(void) pcap_strlcpy(entry->linkname, linkname, DLPI_LINKNAME_MAX);
	if (lwp->lw_list == NULL) {
		lwp->lw_list = entry;
	} else {
		entry->lnl_next = lwp->lw_list;
		lwp->lw_list = entry;
	}
	return (B_FALSE);
}