Changes in uspace/srv/net/ethip/ethip_nic.c [fafb8e5:e82b37e] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/ethip/ethip_nic.c
rfafb8e5 re82b37e 1 1 /* 2 * Copyright (c) 20 12Jiri Svoboda2 * Copyright (c) 2024 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 37 37 #include <adt/list.h> 38 38 #include <async.h> 39 #include <stdbool.h>40 39 #include <errno.h> 41 #include <str_error.h>42 40 #include <fibril_synch.h> 41 #include <inet/eth_addr.h> 43 42 #include <inet/iplink_srv.h> 44 43 #include <io/log.h> 45 44 #include <loc.h> 45 #include <mem.h> 46 46 #include <nic_iface.h> 47 #include <stdbool.h> 47 48 #include <stdlib.h> 48 #include < mem.h>49 #include <str_error.h> 49 50 #include "ethip.h" 50 51 #include "ethip_nic.h" … … 193 194 } 194 195 195 addr48(nic_address.address,nic->mac_addr);196 eth_addr_decode(nic_address.address, &nic->mac_addr); 196 197 197 198 rc = nic_set_state(nic->sess, NIC_STATE_ACTIVE); … … 233 234 uint8_t *addr; 234 235 size_t size; 236 eth_addr_str_t saddr; 235 237 errno_t rc; 236 238 … … 241 243 } 242 244 245 eth_addr_decode(addr, &nic->mac_addr); 246 eth_addr_format(&nic->mac_addr, &saddr); 247 243 248 log_msg(LOG_DEFAULT, LVL_DEBUG, "ethip_nic_addr_changed(): " 244 "new addr=%02x:%02x:%02x:%02x:%02x:%02x", 245 addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]); 246 247 memcpy(&nic->mac_addr, addr, sizeof(nic->mac_addr)); 249 "new addr=%s", saddr.str); 248 250 249 251 rc = iplink_ev_change_addr(&nic->iplink, &nic->mac_addr); … … 399 401 assert(i < count); 400 402 401 addr48_t mac;402 addr48_solicited_node(v6,mac);403 eth_addr_t mac; 404 eth_addr_solicited_node(v6, &mac); 403 405 404 406 /* Avoid duplicate addresses in the list */ … … 407 409 408 410 for (size_t j = 0; j < i; j++) { 409 if (addr48_compare(mac_list[j].address, mac)) { 411 eth_addr_t mac_entry; 412 eth_addr_decode(mac_list[j].address, &mac_entry); 413 if (eth_addr_compare(&mac_entry, &mac)) { 410 414 found = true; 411 415 break; … … 414 418 415 419 if (!found) { 416 addr48(mac, mac_list[i].address);420 eth_addr_encode(&mac, mac_list[i].address); 417 421 i++; 418 } else 422 } else { 419 423 count--; 424 } 420 425 } 421 426
Note:
See TracChangeset
for help on using the changeset viewer.