Changeset 93fb170c in mainline for uspace/srv/net/il/arp/arp.c
- Timestamp:
- 2011-01-08T18:51:31Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 15be932
- Parents:
- 8f748215 (diff), a523af4 (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/il/arp/arp.c
r8f748215 r93fb170c 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));
Note:
See TracChangeset
for help on using the changeset viewer.