[systemd-devel] [systemd-commits] 8 commits - src/libsystemd src/network src/shared src/systemd
Tom Gundersen
teg at jklm.no
Tue Dec 2 05:21:38 PST 2014
On Tue, Dec 2, 2014 at 1:18 PM, Lennart Poettering
<lennart at poettering.net> wrote:
> On Tue, 02.12.14 01:50, Tom Gundersen (tomegun at kemper.freedesktop.org) wrote:
>
>>
>> +/* IEEE Organizationally Unique Identifier vendor string */
>> +static int ieee_oui(struct udev_hwdb *hwdb, struct ether_addr *mac, char **ret) {
>> + struct udev_list_entry *entry;
>> + char *description;
>> + char str[32];
>
> Shouldnt this be "4 + 6*2 + 1"?
>
>> +
>> + /* skip commonly misused 00:00:00 (Xerox) prefix */
>> + if (memcmp(mac, "\0\0\0", 3) == 0)
>> + return -EINVAL;
>> +
>> + snprintf(str, sizeof(str), "OUI:%02X%02X%02X%02X%02X%02X", mac->ether_addr_octet[0], mac->ether_addr_octet[1], mac->ether_addr_octet[2],
>> + mac->ether_addr_octet[3], mac->ether_addr_octet[4], mac->ether_addr_octet[5]);
>> +
>
> Hmm, maybe we should have a new set of macros for this, similar to
> SD_ID128_FORMAT_STR and SD_ID128_FORMAT_VAL?
Fixed both these now. Thanks!
Tom
More information about the systemd-devel
mailing list