Changes in uspace/srv/net/tl/udp/udp.c [014dd57b:348c589] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/tl/udp/udp.c
r014dd57b r348c589 40 40 #include <malloc.h> 41 41 #include <stdio.h> 42 #include <ipc/ipc.h>43 42 #include <ipc/services.h> 44 43 #include <ipc/net.h> … … 61 60 #include <ip_interface.h> 62 61 #include <icmp_client.h> 63 #include <icmp_ interface.h>62 #include <icmp_remote.h> 64 63 #include <net_interface.h> 65 64 #include <socket_core.h> … … 354 353 SERVICE_UDP, IPC_GET_ERROR(*icall)); 355 354 356 ipc_answer_0(iid, (sysarg_t) rc);355 async_answer_0(iid, (sysarg_t) rc); 357 356 break; 358 357 default: 359 ipc_answer_0(iid, (sysarg_t) ENOTSUP);358 async_answer_0(iid, (sysarg_t) ENOTSUP); 360 359 } 361 360 … … 393 392 udp_globals.net_phone = net_phone; 394 393 395 udp_globals.icmp_phone = icmp_connect_module(SERVICE_ICMP, 396 ICMP_CONNECT_TIMEOUT); 394 udp_globals.icmp_phone = icmp_connect_module(ICMP_CONNECT_TIMEOUT); 397 395 398 396 udp_globals.ip_phone = ip_bind_service(SERVICE_IP, IPPROTO_UDP, … … 419 417 rc = packet_dimensions_initialize(&udp_globals.dimensions); 420 418 if (rc != EOK) { 421 socket_ports_destroy(&udp_globals.sockets );419 socket_ports_destroy(&udp_globals.sockets, free); 422 420 fibril_rwlock_write_unlock(&udp_globals.lock); 423 421 return rc; … … 436 434 &data); 437 435 if (rc != EOK) { 438 socket_ports_destroy(&udp_globals.sockets );436 socket_ports_destroy(&udp_globals.sockets, free); 439 437 fibril_rwlock_write_unlock(&udp_globals.lock); 440 438 return rc; … … 501 499 device_id_t device_id; 502 500 packet_dimension_t *packet_dimension; 501 size_t size; 503 502 int rc; 503 504 /* In case of error, do not update the data fragment size. */ 505 *data_fragment_size = 0; 504 506 505 507 rc = tl_get_address_port(addr, addrlen, &dest_port); … … 541 543 packet_dimension = &udp_globals.packet_dimension; 542 544 // } 545 546 /* 547 * Update the data fragment size based on what the lower layers can 548 * handle without fragmentation, but not more than the maximum allowed 549 * for UDP. 550 */ 551 size = MAX_UDP_FRAGMENT_SIZE; 552 if (packet_dimension->content < size) 553 size = packet_dimension->content; 554 *data_fragment_size = size; 543 555 544 556 /* Read the first packet fragment */ … … 788 800 break; 789 801 802 size = MAX_UDP_FRAGMENT_SIZE; 790 803 if (tl_get_ip_packet_dimension(udp_globals.ip_phone, 791 804 &udp_globals.dimensions, DEVICE_INVALID_ID, 792 805 &packet_dimension) == EOK) { 793 SOCKET_SET_DATA_FRAGMENT_SIZE(answer,794 packet_dimension->content);806 if (packet_dimension->content < size) 807 size = packet_dimension->content; 795 808 } 796 797 // SOCKET_SET_DATA_FRAGMENT_SIZE(answer, 798 // MAX_UDP_FRAGMENT_SIZE); 809 SOCKET_SET_DATA_FRAGMENT_SIZE(answer, size); 799 810 SOCKET_SET_HEADER_SIZE(answer, UDP_HEADER_SIZE); 800 811 answer_count = 3; … … 869 880 870 881 /* Release the application phone */ 871 ipc_hangup(app_phone);882 async_hangup(app_phone); 872 883 873 884 /* Release all local sockets */ … … 876 887 877 888 return res; 889 } 890 891 /** Per-connection initialization 892 * 893 */ 894 void tl_connection(void) 895 { 878 896 } 879 897 … … 891 909 * @see IS_NET_UDP_MESSAGE() 892 910 */ 893 int tl_m odule_message(ipc_callid_t callid, ipc_call_t *call,911 int tl_message(ipc_callid_t callid, ipc_call_t *call, 894 912 ipc_call_t *answer, size_t *answer_count) 895 913 {
Note:
See TracChangeset
for help on using the changeset viewer.