uint8_t onwire_ver_remap; /* when this is on, all mapping will use version 1 for now */
uint8_t rx_odd_packets; /* used to warn if too many weird packets are being received */
uint32_t kernel_mtu; /* contains the MTU detected by the kernel on a given link */
int pmtud_waiting;
int pmtud_running;
int pmtud_forcerun;
int pmtud_abort;
struct crypto_instance *crypto_instance[KNET_MAX_CRYPTO_INSTANCES + 1]; /* store an extra pointer to allow 0|1|2 values without too much magic in the code */
uint8_t crypto_in_use_config; /* crypto config to use for TX */
uint8_t crypto_only; /* allow only crypto (1) or also clear (0) traffic */
static int _fast_data_up(knet_handle_t knet_h, struct knet_host *src_host, struct knet_link *src_link)
{
if (src_link->received_pong) {
log_debug(knet_h, KNET_SUB_RX, "host: %u link: %u received data during valid ping/pong activity. Force link up.", src_host->host_id, src_link->link_id);
+ log_warn(knet_h, KNET_SUB_TRANSP_UDP, "Received packet on ifindex %d when expected ifindex %d", pkt_ifindex, ifindex);
+ } else if (knet_addrtostr(msg->msg_name, msg->msg_namelen,
+ srcaddr_s, sizeof(srcaddr_s),
+ srcport_s, sizeof(srcport_s)) != 0) {
+ log_warn(knet_h, KNET_SUB_TRANSP_UDP, "Received packet on i/f %s when expected i/f %s", used_ifname, expected_ifname);
+ } else if (knet_addrtostr((struct sockaddr_storage *)&dstaddr, sizeof(dstaddr),
+ dstaddr_s, sizeof(dstaddr_s),
+ dstport_s, sizeof(dstport_s)) != 0) {
+ log_warn(knet_h, KNET_SUB_TRANSP_UDP, "Received packet from %s on i/f %s when expected %s", srcaddr_s, used_ifname, expected_ifname);
+ } else {
+ log_warn(knet_h, KNET_SUB_TRANSP_UDP, "Received packet from %s to %s on i/f %s when expected %s", srcaddr_s, dstaddr_s, used_ifname, expected_ifname);
+ }
+ }
+ }
+#endif
+ return 0;
+}
+
+
transport_rx_isdata_t udp_transport_rx_is_data(knet_handle_t knet_h, int sockfd, struct knet_mmsghdr *msg)
{
if (msg->msg_len == 0)
return KNET_TRANSPORT_RX_NOT_DATA_CONTINUE;
- return KNET_TRANSPORT_RX_IS_DATA;
+ if (dst_addr_is_valid(knet_h, sockfd, &msg->msg_hdr) == 0) {
+ return KNET_TRANSPORT_RX_IS_DATA;
+ }
+
+ return KNET_TRANSPORT_RX_NOT_DATA_CONTINUE;
}
int udp_transport_link_dyn_connect(knet_handle_t knet_h, int sockfd, struct knet_link *kn_link)
{
kn_link->status.dynconnected = 1;
return 0;
}
int udp_transport_link_is_down(knet_handle_t knet_h, struct knet_link *kn_link)