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