mirror of
https://github.com/albfan/miraclecast.git
synced 2025-03-09 23:38:56 +00:00
wifi: reformat MACs returned from DHCP
ether_ntoa() function used in DHCP server skips leading zeros so reformat is needed to make strcmp() work for mac-comparisons. Signed-off-by: Andrey Gusakov <andrey.gusakov@cogentembedded.com> Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
This commit is contained in:
parent
e40f7f744e
commit
9b801d6b0e
1 changed files with 3 additions and 1 deletions
|
@ -220,6 +220,7 @@ static int supplicant_group_comm_fn(sd_event_source *source,
|
||||||
struct peer *p;
|
struct peer *p;
|
||||||
char buf[512], *t, *ip;
|
char buf[512], *t, *ip;
|
||||||
ssize_t l;
|
ssize_t l;
|
||||||
|
char mac[MAC_STRLEN];
|
||||||
|
|
||||||
l = recv(fd, buf, sizeof(buf) - 1, MSG_DONTWAIT);
|
l = recv(fd, buf, sizeof(buf) - 1, MSG_DONTWAIT);
|
||||||
if (l < 0) {
|
if (l < 0) {
|
||||||
|
@ -271,7 +272,8 @@ static int supplicant_group_comm_fn(sd_event_source *source,
|
||||||
}
|
}
|
||||||
|
|
||||||
*ip++ = 0;
|
*ip++ = 0;
|
||||||
sp = find_peer_by_any_mac(g->s, t);
|
reformat_mac(mac, t);
|
||||||
|
sp = find_peer_by_any_mac(g->s, mac);
|
||||||
if (sp) {
|
if (sp) {
|
||||||
ip = strdup(ip);
|
ip = strdup(ip);
|
||||||
if (!ip) {
|
if (!ip) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue