Skip to content

Commit

Permalink
Merge pull request #818 from rtorrero/arp-void-check
Browse files Browse the repository at this point in the history
address: don't check hwaddr length if parsing as ARPHRD_VOID
  • Loading branch information
mtomaschewski committed Dec 5, 2019
2 parents b253fd6 + c53f71e commit b7cf5ac
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/address.c
Expand Up @@ -1447,7 +1447,7 @@ ni_link_address_parse(ni_hwaddr_t *hwa, unsigned short arp_type, const char *str
if ((len = ni_parse_hex(string, tmp.data, NI_MAXHWADDRLEN)) < 0)
return -1;

if (ni_link_address_length(arp_type) != (unsigned int)len)
if (arp_type != ARPHRD_VOID && ni_link_address_length(arp_type) != (unsigned int)len)
return -1;

memcpy(hwa->data, tmp.data, len);
Expand Down Expand Up @@ -1712,4 +1712,3 @@ ni_address_cache_info_rebase(ni_address_cache_info_t *res, const ni_address_cach
res->preferred_lft = NI_LIFETIME_EXPIRED;
#undef rebase_lft
}

0 comments on commit b7cf5ac

Please sign in to comment.