modem: quectel-bg9x: 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 TCP on top of IPv4 and IPv6. Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
This commit is contained in:
parent
61dfdf1d60
commit
f9e2fad7e3
1 changed files with 13 additions and 0 deletions
|
@ -1085,6 +1085,19 @@ 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_STREAM) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (proto != IPPROTO_TCP) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue