Changes in uspace/srv/net/il/arp/arp.c [7837101:774e6d1a] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/il/arp/arp.c
r7837101 r774e6d1a 457 457 uint8_t *des_proto; 458 458 int rc; 459 459 460 460 length = packet_get_data_length(packet); 461 461 if (length <= sizeof(arp_header_t)) … … 482 482 des_hw = src_proto + header->protocol_length; 483 483 des_proto = des_hw + header->hardware_length; 484 trans = arp_addr_find(&proto->addresses, (char *)src_proto,484 trans = arp_addr_find(&proto->addresses, src_proto, 485 485 header->protocol_length); 486 486 /* Exists? */ … … 493 493 if (proto->addr->length != header->protocol_length) 494 494 return EINVAL; 495 if (!str_lcmp(proto->addr->value, (char *) des_proto,496 495 496 if (!bcmp(proto->addr->value, des_proto, proto->addr->length)) { 497 497 /* Not already updated? */ 498 498 if (!trans) { … … 502 502 trans->hw_addr = NULL; 503 503 fibril_condvar_initialize(&trans->cv); 504 rc = arp_addr_add(&proto->addresses, (char *)src_proto,504 rc = arp_addr_add(&proto->addresses, src_proto, 505 505 header->protocol_length, trans); 506 506 if (rc != EOK) { … … 510 510 } 511 511 if (!trans->hw_addr) { 512 trans->hw_addr = measured_string_create_bulk( 513 (char *) src_hw,header->hardware_length);512 trans->hw_addr = measured_string_create_bulk(src_hw, 513 header->hardware_length); 514 514 if (!trans->hw_addr) 515 515 return ENOMEM; 516 516 517 517 /* Notify the fibrils that wait for the translation. */ 518 518 fibril_condvar_broadcast(&trans->cv); … … 677 677 int 678 678 arp_message_standalone(ipc_callid_t callid, ipc_call_t *call, 679 ipc_call_t *answer, int *answer_count)679 ipc_call_t *answer, size_t *answer_count) 680 680 { 681 681 measured_string_t *address; 682 682 measured_string_t *translation; 683 char*data;683 uint8_t *data; 684 684 packet_t *packet; 685 685 packet_t *next; … … 696 696 return rc; 697 697 698 rc = arp_device_message(IPC_GET_DEVICE( call),699 IPC_GET_SERVICE( call), ARP_GET_NETIF(call), address);698 rc = arp_device_message(IPC_GET_DEVICE(*call), 699 IPC_GET_SERVICE(*call), ARP_GET_NETIF(*call), address); 700 700 if (rc != EOK) { 701 701 free(address); … … 710 710 711 711 fibril_mutex_lock(&arp_globals.lock); 712 rc = arp_translate_message(IPC_GET_DEVICE( call),713 IPC_GET_SERVICE( call), address, &translation);712 rc = arp_translate_message(IPC_GET_DEVICE(*call), 713 IPC_GET_SERVICE(*call), address, &translation); 714 714 free(address); 715 715 free(data); … … 727 727 728 728 case NET_ARP_CLEAR_DEVICE: 729 return arp_clear_device_req(0, IPC_GET_DEVICE( call));729 return arp_clear_device_req(0, IPC_GET_DEVICE(*call)); 730 730 731 731 case NET_ARP_CLEAR_ADDRESS: … … 734 734 return rc; 735 735 736 arp_clear_address_req(0, IPC_GET_DEVICE( call),737 IPC_GET_SERVICE( call), address);736 arp_clear_address_req(0, IPC_GET_DEVICE(*call), 737 IPC_GET_SERVICE(*call), address); 738 738 free(address); 739 739 free(data); … … 748 748 749 749 case NET_IL_RECEIVED: 750 750 751 rc = packet_translate_remote(arp_globals.net_phone, &packet, 751 IPC_GET_PACKET( call));752 IPC_GET_PACKET(*call)); 752 753 if (rc != EOK) 753 754 return rc; … … 756 757 do { 757 758 next = pq_detach(packet); 758 rc = arp_receive_message(IPC_GET_DEVICE( call), packet);759 rc = arp_receive_message(IPC_GET_DEVICE(*call), packet); 759 760 if (rc != 1) { 760 761 pq_release_remote(arp_globals.net_phone, … … 768 769 769 770 case NET_IL_MTU_CHANGED: 770 return arp_mtu_changed_message(IPC_GET_DEVICE( call),771 IPC_GET_MTU( call));771 return arp_mtu_changed_message(IPC_GET_DEVICE(*call), 772 IPC_GET_MTU(*call)); 772 773 } 773 774 … … 790 791 while (true) { 791 792 ipc_call_t answer; 792 int answer_count;793 size_t count; 793 794 794 795 /* Clear the answer structure */ 795 refresh_answer(&answer, & answer_count);796 refresh_answer(&answer, &count); 796 797 797 798 /* Fetch the next message */ … … 801 802 /* Process the message */ 802 803 int res = il_module_message_standalone(callid, &call, &answer, 803 & answer_count);804 &count); 804 805 805 806 /* … … 812 813 813 814 /* Answer the message */ 814 answer_call(callid, res, &answer, answer_count);815 answer_call(callid, res, &answer, count); 815 816 } 816 817 }
Note:
See TracChangeset
for help on using the changeset viewer.