Skip to content

Commit

Permalink
Clear the MAC Address field in device node
Browse files Browse the repository at this point in the history
This avoids pushing garbage into the device node, e.g.:

00000000  07 00 00 00 01 00 00 00  44 00 54 00 45 00 53 00  |........D.T.E.S.|
00000010  54 00 32 00 00 00 03 0b  25 00 52 54 00 04 a7 a0  |T.2.....%.RT....|
00000020  00 00 00 00 00 00 00 00  65 66 69 76 61 72 73 2f  |........efivars/|
                                   ^^^^^^^^^^^^^^^^^^^^^^^
00000030  42 6f 6f 74 30 30 30 33  2d 38 01 03 0c 1b 00 00  |Boot0003-8......|
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
00000040  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000050  00 00 00 00 00 00 7f ff  04 00                    |..........|
0000005a
  • Loading branch information
rmetrich committed Jun 2, 2022
1 parent 7851568 commit 881bafe
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/dp-message.c
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,7 @@ efidp_make_mac_addr(uint8_t *buf, ssize_t size, uint8_t if_type,
ssize_t req = sizeof (*mac);
if (size && sz == req) {
mac->if_type = if_type;
memset(mac->mac_addr, 0, 32);
memcpy(mac->mac_addr, mac_addr,
mac_addr_size > 32 ? 32 : mac_addr_size);
}
Expand Down

0 comments on commit 881bafe

Please sign in to comment.