Changeset 7837101e in mainline
- Timestamp:
- 2010-12-16T16:58:41Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1b59023
- Parents:
- 7bdcc45
- Location:
- uspace/srv/net
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/il/arp/arp.c
r7bdcc45 r7837101e 483 483 des_proto = des_hw + header->hardware_length; 484 484 trans = arp_addr_find(&proto->addresses, (char *) src_proto, 485 CONVERT_SIZE(uint8_t, char, header->protocol_length));485 header->protocol_length); 486 486 /* Exists? */ 487 487 if (trans && trans->hw_addr) { 488 if (trans->hw_addr->length != CONVERT_SIZE(uint8_t, char, 489 header->hardware_length)) { 488 if (trans->hw_addr->length != header->hardware_length) 490 489 return EINVAL; 491 }492 490 memcpy(trans->hw_addr->value, src_hw, trans->hw_addr->length); 493 491 } 494 492 /* Is my protocol address? */ 495 if (proto->addr->length != CONVERT_SIZE(uint8_t, char, 496 header->protocol_length)) { 493 if (proto->addr->length != header->protocol_length) 497 494 return EINVAL; 498 }499 495 if (!str_lcmp(proto->addr->value, (char *) des_proto, 500 496 proto->addr->length)) { … … 507 503 fibril_condvar_initialize(&trans->cv); 508 504 rc = arp_addr_add(&proto->addresses, (char *) src_proto, 509 CONVERT_SIZE(uint8_t, char, header->protocol_length), 510 trans); 505 header->protocol_length, trans); 511 506 if (rc != EOK) { 512 507 /* The generic char map has already freed trans! */ … … 516 511 if (!trans->hw_addr) { 517 512 trans->hw_addr = measured_string_create_bulk( 518 (char *) src_hw, CONVERT_SIZE(uint8_t, char, 519 header->hardware_length)); 513 (char *) src_hw, header->hardware_length); 520 514 if (!trans->hw_addr) 521 515 return ENOMEM; … … 606 600 607 601 /* ARP packet content size = header + (address + translation) * 2 */ 608 length = 8 + 2 * (CONVERT_SIZE(char, uint8_t, proto->addr->length) + 609 CONVERT_SIZE(char, uint8_t, device->addr->length)); 602 length = 8 + 2 * (proto->addr->length + device->addr->length); 610 603 if (length > device->packet_dimension.content) 611 604 return ELIMIT; … … 640 633 641 634 rc = packet_set_addr(packet, (uint8_t *) device->addr->value, 642 (uint8_t *) device->broadcast_addr->value, 643 CONVERT_SIZE(char, uint8_t, device->addr->length)); 635 (uint8_t *) device->broadcast_addr->value, device->addr->length); 644 636 if (rc != EOK) { 645 637 pq_release_remote(arp_globals.net_phone, packet_get_id(packet)); -
uspace/srv/net/il/ip/ip.c
r7bdcc45 r7837101e 639 639 if (destination) { 640 640 rc = packet_set_addr(packet, NULL, (uint8_t *) destination->value, 641 CONVERT_SIZE(char, uint8_t, destination->length));641 destination->length); 642 642 } else { 643 643 rc = packet_set_addr(packet, NULL, NULL, 0); … … 687 687 rc = packet_set_addr(next, NULL, 688 688 (uint8_t *) destination->value, 689 CONVERT_SIZE(char, uint8_t, 690 destination->length)); 689 destination->length); 691 690 if (rc != EOK) { 692 691 free(last_header); … … 718 717 rc = packet_set_addr(next, NULL, 719 718 (uint8_t *) destination->value, 720 CONVERT_SIZE(char, uint8_t, destination->length));719 destination->length); 721 720 if (rc != EOK) { 722 721 free(last_header); … … 1758 1757 // clear the ARP mapping if any 1759 1758 address.value = (char *) &header->destination_address; 1760 address.length = CONVERT_SIZE(uint8_t, char, 1761 sizeof(header->destination_address)); 1759 address.length = sizeof(header->destination_address); 1762 1760 arp_clear_address_req(netif->arp->phone, 1763 1761 netif->device_id, SERVICE_IP, &address); -
uspace/srv/net/nil/eth/eth.c
r7bdcc45 r7837101e 201 201 202 202 eth_globals.broadcast_addr = 203 measured_string_create_bulk("\xFF\xFF\xFF\xFF\xFF\xFF", 204 CONVERT_SIZE(uint8_t, char, ETH_ADDR)); 203 measured_string_create_bulk("\xFF\xFF\xFF\xFF\xFF\xFF", ETH_ADDR); 205 204 if (!eth_globals.broadcast_addr) { 206 205 rc = ENOMEM;
Note:
See TracChangeset
for help on using the changeset viewer.