Skip to content

Commit

Permalink
net: Reordered net context connect operation
Browse files Browse the repository at this point in the history
Moved socket offload connect ahead of non offload connect
implementation to fix issue with multiple network interfaces

Signed-off-by: Matt Wood <[email protected]>
  • Loading branch information
matt-wood-ct committed Feb 17, 2024
1 parent 545d68a commit 3a302ff
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions subsys/net/ip/net_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -1198,6 +1198,19 @@ int net_context_connect(struct net_context *context,
goto unlock;
}

if (IS_ENABLED(CONFIG_NET_OFFLOAD) &&

Check warning on line 1201 in subsys/net/ip/net_context.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

LEADING_SPACE

subsys/net/ip/net_context.c:1201 please, no spaces at the start of a line
net_if_is_ip_offloaded(net_context_get_iface(context))) {

Check failure on line 1202 in subsys/net/ip/net_context.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

CODE_INDENT

subsys/net/ip/net_context.c:1202 code indent should use tabs where possible

Check warning on line 1202 in subsys/net/ip/net_context.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

LEADING_SPACE

subsys/net/ip/net_context.c:1202 please, no spaces at the start of a line
ret = net_offload_connect(

Check failure on line 1203 in subsys/net/ip/net_context.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

CODE_INDENT

subsys/net/ip/net_context.c:1203 code indent should use tabs where possible

Check warning on line 1203 in subsys/net/ip/net_context.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

LEADING_SPACE

subsys/net/ip/net_context.c:1203 please, no spaces at the start of a line
net_context_get_iface(context),

Check failure on line 1204 in subsys/net/ip/net_context.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

CODE_INDENT

subsys/net/ip/net_context.c:1204 code indent should use tabs where possible

Check warning on line 1204 in subsys/net/ip/net_context.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

LEADING_SPACE

subsys/net/ip/net_context.c:1204 please, no spaces at the start of a line
context,

Check failure on line 1205 in subsys/net/ip/net_context.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

CODE_INDENT

subsys/net/ip/net_context.c:1205 code indent should use tabs where possible

Check warning on line 1205 in subsys/net/ip/net_context.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

LEADING_SPACE

subsys/net/ip/net_context.c:1205 please, no spaces at the start of a line
addr,

Check failure on line 1206 in subsys/net/ip/net_context.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

CODE_INDENT

subsys/net/ip/net_context.c:1206 code indent should use tabs where possible

Check warning on line 1206 in subsys/net/ip/net_context.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

LEADING_SPACE

subsys/net/ip/net_context.c:1206 please, no spaces at the start of a line
addrlen,

Check failure on line 1207 in subsys/net/ip/net_context.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

CODE_INDENT

subsys/net/ip/net_context.c:1207 code indent should use tabs where possible

Check warning on line 1207 in subsys/net/ip/net_context.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

LEADING_SPACE

subsys/net/ip/net_context.c:1207 please, no spaces at the start of a line
cb,

Check failure on line 1208 in subsys/net/ip/net_context.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

CODE_INDENT

subsys/net/ip/net_context.c:1208 code indent should use tabs where possible

Check warning on line 1208 in subsys/net/ip/net_context.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

LEADING_SPACE

subsys/net/ip/net_context.c:1208 please, no spaces at the start of a line
timeout,

Check failure on line 1209 in subsys/net/ip/net_context.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

CODE_INDENT

subsys/net/ip/net_context.c:1209 code indent should use tabs where possible

Check warning on line 1209 in subsys/net/ip/net_context.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

LEADING_SPACE

subsys/net/ip/net_context.c:1209 please, no spaces at the start of a line
user_data);

Check failure on line 1210 in subsys/net/ip/net_context.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

CODE_INDENT

subsys/net/ip/net_context.c:1210 code indent should use tabs where possible

Check warning on line 1210 in subsys/net/ip/net_context.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

LEADING_SPACE

subsys/net/ip/net_context.c:1210 please, no spaces at the start of a line
goto unlock;

Check failure on line 1211 in subsys/net/ip/net_context.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

CODE_INDENT

subsys/net/ip/net_context.c:1211 code indent should use tabs where possible
}

if (IS_ENABLED(CONFIG_NET_IPV6) &&
net_context_get_family(context) == AF_INET6) {
struct sockaddr_in6 *addr6 = (struct sockaddr_in6 *)
Expand Down Expand Up @@ -1297,19 +1310,6 @@ int net_context_connect(struct net_context *context,
goto unlock;
}

if (IS_ENABLED(CONFIG_NET_OFFLOAD) &&
net_if_is_ip_offloaded(net_context_get_iface(context))) {
ret = net_offload_connect(
net_context_get_iface(context),
context,
addr,
addrlen,
cb,
timeout,
user_data);
goto unlock;
}

if (IS_ENABLED(CONFIG_NET_UDP) &&
net_context_get_type(context) == SOCK_DGRAM) {
if (cb) {
Expand Down

0 comments on commit 3a302ff

Please sign in to comment.