Ignore:
Timestamp:
2021-10-24T08:28:43Z (2 years ago)
Author:
GitHub <noreply@…>
Children:
f628215
Parents:
2ce943a (diff), cd981f2a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Erik Kučák <35500848+Riko196@…> (2021-10-24 08:28:43)
git-committer:
GitHub <noreply@…> (2021-10-24 08:28:43)
Message:

Merge branch 'HelenOS:master' into master

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/drv/generic/remote_ieee80211.c

    r2ce943a r8a9a41e  
    11/*
     2 * Copyright (c) 2021 Jiri Svoboda
    23 * Copyright (c) 2015 Jan Kolarik
    34 * All rights reserved.
     
    8485}
    8586
    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
    9688static sysarg_t get_link_id(uint8_t *mac)
    9789{
    9890        sysarg_t *link_list;
    9991        inet_link_info_t link_info;
     92        eth_addr_t eth_addr;
    10093        size_t count;
     94
     95        eth_addr_decode(mac, &eth_addr);
    10196
    10297        errno_t rc = inetcfg_get_link_list(&link_list, &count);
     
    109104                        return -1;
    110105
    111                 if (mac_matches(mac, link_info.mac_addr))
     106                if (eth_addr_compare(&eth_addr, &link_info.mac_addr) == 0)
    112107                        return link_list[i];
    113108        }
     
    170165                return rc;
    171166
     167        // XXX This is wrong. Wifi should not initiate DHCP
     168
    172169        /* Send DHCP discover. */
    173170        nic_address_t wifi_mac;
     
    207204        if (rc != EOK)
    208205                return rc;
     206
     207        eth_addr_t eth_addr;
     208        eth_addr_decode(wifi_mac.address, &eth_addr);
    209209
    210210        inet_link_info_t link_info;
     
    215215        size_t count;
    216216
     217        /// XXX This is wrong. Wifi should do nothing with DHCP
     218
    217219        /* Remove previous DHCP address. */
    218220        rc = inetcfg_get_addr_list(&addr_list, &count);
     
    229231                        return rc;
    230232
    231                 if (mac_matches(wifi_mac.address, link_info.mac_addr)) {
     233                if (eth_addr_compare(&eth_addr, &link_info.mac_addr) == 0) {
    232234                        if (str_test_prefix(addr_info.name, "dhcp")) {
    233235                                rc = inetcfg_addr_delete(addr_list[i]);
Note: See TracChangeset for help on using the changeset viewer.