diff --git a/net/ip/Kconfig b/net/ip/Kconfig index 8cb4863acb1..c98f8499a2d 100644 --- a/net/ip/Kconfig +++ b/net/ip/Kconfig @@ -71,6 +71,14 @@ config IP_TIMER_STACK_SIZE responsible for handling re-transmissions and periodic network packet sending like IPv6 router solicitations. +config NET_MAX_CONTEXTS + int "How many network context to use" + default 2 + help + The network context is similar concept as network socket. + It defines a network endpoint and number of context depends + on application usage. + choice prompt "Internet Protocol version" depends on NETWORKING diff --git a/net/ip/net_context.c b/net/ip/net_context.c index 82926565f4c..0b00a505333 100644 --- a/net/ip/net_context.c +++ b/net/ip/net_context.c @@ -80,7 +80,9 @@ struct net_context { }; /* Override this in makefile if needed */ -#ifndef NET_MAX_CONTEXT +#if defined(CONFIG_NET_MAX_CONTEXTS) +#define NET_MAX_CONTEXT CONFIG_NET_MAX_CONTEXTS +#else #define NET_MAX_CONTEXT 5 #endif