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