﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	field_blocks	field_dependson	field_seealso
672	UDP crashing network stack	Stanislav Gálfy		"When there is no UDP association on which udp message can be received the whole receiving part of network stack crashes. The reason is assertion at line 413 in /uspace/srv/net/udp/assoc.c in function udp_assoc_find_ref.


static udp_assoc_t *udp_assoc_find_ref(inet_ep2_t *epp)
{
	int rc;
	void *arg;
	udp_assoc_t *assoc;

	log_msg(LOG_DEFAULT, LVL_DEBUG, ""udp_assoc_find_ref(%p)"", epp);
	fibril_mutex_lock(&assoc_list_lock);

	rc = amap_find_match(amap, epp, &arg);
	if (rc != EOK) {
  	        [[span(style=color: #FF0000, assert(rc == ENOMEM); )]]
                fibril_mutex_unlock(&assoc_list_lock);
                return NULL;
	}

	assoc = (udp_assoc_t *)arg;
	udp_assoc_addref(assoc);

	fibril_mutex_unlock(&assoc_list_lock);
	return assoc;
}

Here amap_find_match returns ENOENT, so next assert(rc == ENOMEM); crashes udp module and EHANGUP is propagated all the way down to driver, stopping the invocation of callbacks when receiving.

This is also the cause of bug #667 ( http://www.helenos.org/ticket/667 ) where unix on the other side was broadcasting some udp packets that crashed the network stack, leading to ping not working afterwards."	defect	closed	major		helenos/net/udp	mainline	fixed					
