/* Create an entry for a newly registered interface  */
static int create_if_entry(kernel_pid_t if_pid, nhdp_addr_t *addr)
/* Create an entry for a newly registered interface  */
static int create_if_entry(kernel_pid_t if_pid, nhdp_addr_t *addr)
{
    lib_entry_t *new_entry;
    new_entry = (lib_entry_t *) malloc(sizeof(lib_entry_t));
    if (!new_entry) {
        return -1;
    }
    new_entry->if_addr_list_head = NULL;
    new_entry->if_pid = if_pid;
    if (add_address_to_if(new_entry, addr)) {
        free(new_entry);
        return -1;
    }
    LL_PREPEND(lib_entry_head, new_entry);
    return 0;
}