modem: sim7080: implement 'is_supported' socket offload cb
Check if requested socket family, type and protocol are all supported by the driver, instead of blindly acknowledging every possible variant. There is explicit support for UDP and TCP on top of IPv4 and IPv6. Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
This commit is contained in:
parent
a0c5c176a0
commit
61dfdf1d60
1 changed files with 15 additions and 0 deletions
|
@ -746,6 +746,21 @@ static struct net_if_api api_funcs = {
|
|||
|
||||
static bool offload_is_supported(int family, int type, int proto)
|
||||
{
|
||||
if (family != AF_INET &&
|
||||
family != AF_INET6) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (type != SOCK_DGRAM &&
|
||||
type != SOCK_STREAM) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (proto != IPPROTO_TCP &&
|
||||
proto != IPPROTO_UDP) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue