pointer to a binary or ASCII hardware address, or null
size of hwaddr1, or -1 if hwaddr1 is ASCII
pointer to a binary or ASCII hardware address, or null
size of hwaddr2, or -1 if hwaddr2 is ASCII
true if hwaddr1 and hwaddr2 are equivalent, false if they are different (or either of them is invalid).
Generalized hardware address comparison function. Tests if
hwaddr1andhwaddr2"equal" (or more precisely, "equivalent"), with several advantages over a simplememcmp():If
hwaddr1_lenorhwaddr2_lenis -1, then the corresponding address is assumed to be ASCII rather than binary, and will be converted to binary before being compared.If
hwaddr1orhwaddr2isnull, it is treated instead as though it was a zero-filled bufferhwaddr1_lenorhwaddr2_lenbytes long.IfINFINIBAND_ALEN bytes long in binary form)
then only the last 8 bytes are compared, since those are the only bytes
that actually identify the hardware. (The other 12 bytes will change
depending on the configuration of the InfiniBand fabric that the device
is connected to.)
hwaddr1andhwaddr2are InfiniBand hardware addresses (that is, if they areIf a passed-in ASCII hardware address cannot be parsed, or would parse to an address larger than
NM_UTILS_HWADDR_LEN_MAX, then it will silently fail to match. (This means that externally-provided address strings do not need to be sanity-checked before comparing them against known good addresses; they are guaranteed to not match if they are invalid.)