net: Fix compile warnings when building with UDP disabled

The sanity checker should check for these as well eventually.

Change-Id: Ia22c8d0e000ee315ee2f582caa5a6b0c721e8b5f
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
This commit is contained in:
Leandro Pereira 2016-11-17 11:00:15 -08:00 committed by Jukka Rissanen
parent d02a9692ff
commit 99e4aa5dd4

View File

@ -1670,6 +1670,7 @@ enum net_verdict packet_received(struct net_conn *conn,
return NET_DROP;
}
#if defined(CONFIG_NET_UDP)
static int recv_udp(struct net_context *context,
net_context_recv_cb_t cb,
int32_t timeout,
@ -1729,14 +1730,13 @@ static int recv_udp(struct net_context *context,
return ret;
}
#endif /* CONFIG_NET_UDP */
int net_context_recv(struct net_context *context,
net_context_recv_cb_t cb,
int32_t timeout,
void *user_data)
{
int ret;
NET_ASSERT(context);
if (!net_context_is_used(context)) {
@ -1745,7 +1745,7 @@ int net_context_recv(struct net_context *context,
#if defined(CONFIG_NET_UDP)
if (net_context_get_ip_proto(context) == IPPROTO_UDP) {
ret = recv_udp(context, cb, timeout, user_data);
int ret = recv_udp(context, cb, timeout, user_data);
if (ret < 0) {
return ret;
}