Skip to content

net: context: Verify if CONFIG_NET_SOCKETS_PACKET_DGRAM is enabled #90603

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions subsys/net/ip/net_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,11 @@ static int net_context_check(sa_family_t family, enum net_sock_type type,
NET_DBG("AF_PACKET disabled");
return -EPFNOSUPPORT;
}
if (!IS_ENABLED(CONFIG_NET_SOCKETS_PACKET_DGRAM) &&
type == SOCK_DGRAM) {
NET_DBG("DGRAM socket type disabled.");
return -EPROTOTYPE;
}
if (type != SOCK_RAW && type != SOCK_DGRAM) {
NET_DBG("AF_PACKET only supports RAW and DGRAM socket "
"types.");
Expand Down
Loading