Changes in uspace/lib/drv/generic/remote_ieee80211.c [fafb8e5:3e6bca8] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/drv/generic/remote_ieee80211.c
rfafb8e5 r3e6bca8 1 1 /* 2 * Copyright (c) 2021 Jiri Svoboda 2 3 * Copyright (c) 2015 Jan Kolarik 3 4 * All rights reserved. … … 84 85 } 85 86 86 static bool mac_matches(uint8_t *mac1, uint8_t *mac2) 87 { 88 for (size_t i = 0; i < ETH_ADDR; i++) { 89 if (mac1[i] != mac2[i]) 90 return false; 91 } 92 93 return true; 94 } 95 87 // XXX This is wrong. Wifi should not have anything to do with IP links 96 88 static sysarg_t get_link_id(uint8_t *mac) 97 89 { 98 90 sysarg_t *link_list; 99 91 inet_link_info_t link_info; 92 eth_addr_t eth_addr; 100 93 size_t count; 94 95 eth_addr_decode(mac, ð_addr); 101 96 102 97 errno_t rc = inetcfg_get_link_list(&link_list, &count); … … 109 104 return -1; 110 105 111 if ( mac_matches(mac, link_info.mac_addr))106 if (eth_addr_compare(ð_addr, &link_info.mac_addr) == 0) 112 107 return link_list[i]; 113 108 } … … 170 165 return rc; 171 166 167 // XXX This is wrong. Wifi should not initiate DHCP 168 172 169 /* Send DHCP discover. */ 173 170 nic_address_t wifi_mac; … … 207 204 if (rc != EOK) 208 205 return rc; 206 207 eth_addr_t eth_addr; 208 eth_addr_decode(wifi_mac.address, ð_addr); 209 209 210 210 inet_link_info_t link_info; … … 215 215 size_t count; 216 216 217 /// XXX This is wrong. Wifi should do nothing with DHCP 218 217 219 /* Remove previous DHCP address. */ 218 220 rc = inetcfg_get_addr_list(&addr_list, &count); … … 229 231 return rc; 230 232 231 if ( mac_matches(wifi_mac.address, link_info.mac_addr)) {233 if (eth_addr_compare(ð_addr, &link_info.mac_addr) == 0) { 232 234 if (str_test_prefix(addr_info.name, "dhcp")) { 233 235 rc = inetcfg_addr_delete(addr_list[i]);
Note:
See TracChangeset
for help on using the changeset viewer.