Remove `gpgme` from `modes_default` in `data/build/tacocat/settings.tacocat`.
The `// @todo port here.` seems to not be needed.
There is random selecting of `host.h_addr_list` does not seem to be used.
Remove this dead code.
Remove redundant allocation increase.
Call `f_network_from_host_short()` rather than directly calling `htons()`.
Add port number in network address printing messages.
version_target minor
modes android clang coverage debug fanalyzer flex_arrays gcc gpgme individual individual_thread level monolithic pinephone test thread threadless
-modes_default debug gcc gpgme monolithic thread
+modes_default debug gcc monolithic thread
build_compiler gcc
build_compiler-clang clang
main->setting.state.status = f_network_from_ip_string(address, &family);
macro_kt_tacocat_handle_load_send_receive_error_continue_2();
-
- // @todo port here.
}
else {
main->setting.state.status = f_network_from_ip_name(address, &host);
macro_kt_tacocat_handle_load_send_receive_error_continue_2();
- // Randomly select one of the addresses when there are more than one.
- if (host.h_addr_list[1]) {
- k = 2;
-
- while (host.h_addr_list[k++]);
-
- // Real randomness or security is not needed here, so fiddle with predictable but somewhat dynamic numbers.
- srand(main->program.pid + j + host.h_addr_list[0][0]);
- k = rand() % (k - 1);
- }
- else {
- k = 0;
- }
-
- main->setting.state.status = f_memory_array_increase_by(INET6_ADDRSTRLEN + 1, sizeof(f_char_t), (void **) &sets[i]->array[j].network.string, &sets[i]->array[j].network.used, &sets[i]->array[j].network.size);
-
- macro_kt_tacocat_handle_load_send_receive_error_continue_2();
-
main->setting.state.status = f_network_to_ip_string(family, &sets[i]->array[j].network);
if (main->setting.state.status == F_data_not || !host.h_addr_list || !host.h_addr_list[0]) {
if (host.h_addrtype == f_socket_address_family_inet4_e) {
sets[i]->array[j].socket.domain = f_socket_protocol_family_inet4_e;
sets[i]->array[j].socket.address.inet4.sin_family = f_socket_address_family_inet4_e;
- sets[i]->array[j].socket.address.inet4.sin_port = htons((in_port_t) sets[i]->array[j].port);
sets[i]->array[j].socket.address.inet4.sin_addr.s_addr = family.address.v4.s_addr;
+
+ main->setting.state.status = f_network_from_host_short(sets[i]->array[j].port, &sets[i]->array[j].socket.address.inet4.sin_port);
+
+ macro_kt_tacocat_handle_load_send_receive_error_continue_2();
}
else if (host.h_addrtype == f_socket_address_family_inet6_e) {
sets[i]->array[j].socket.domain = f_socket_protocol_family_inet6_e;
sets[i]->array[j].socket.address.inet4.sin_family = f_socket_address_family_inet6_e;
- sets[i]->array[j].socket.address.inet6.sin6_port = htons((in_port_t) sets[i]->array[j].port);
sets[i]->array[j].socket.address.inet6.sin6_addr = family.address.v6;
+
+ main->setting.state.status = f_network_from_host_short(sets[i]->array[j].port, &sets[i]->array[j].socket.address.inet6.sin6_port);
+
+ macro_kt_tacocat_handle_load_send_receive_error_continue_2();
}
}
else {
fl_print_format("%rPacket from ", print->to, f_string_eol_s);
fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, set.network, print->set->notable);
+ fl_print_format(" port ", print->to);
+ fl_print_format(f_string_format_ul_single_s.string, print->to, print->set->notable, set.port, print->set->notable);
fl_print_format(" is complete.%r", print->to, f_string_eol_s);
f_file_stream_unlock(print->to);
fl_print_format("%rPacket from ", print->to, f_string_eol_s);
fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, set.network, print->set->notable);
+ fl_print_format(" port ", print->to);
+ fl_print_format(f_string_format_ul_single_s.string, print->to, print->set->notable, set.port, print->set->notable);
fl_print_format(" is %[%ul%] Bytes.%r", print->to, print->set->notable, set.packet.size, print->set->notable, f_string_eol_s);
f_file_stream_unlock(print->to);
fl_print_format("%rReceived packet from ", print->to, f_string_eol_s);
fl_print_format(f_string_format_Q_single_s.string, print->to, print->set->notable, set.network, print->set->notable);
+ fl_print_format(" port ", print->to);
+ fl_print_format(f_string_format_ul_single_s.string, print->to, print->set->notable, set.port, print->set->notable);
if (print->verbosity > f_console_verbosity_normal_e) {
fl_print_format(" (appending to file '", print->to);