Skip to content

Conversation

@rveerama1
Copy link
Contributor

When net_app_ctx has multiple net_contexts, selecting net_context based on dst address has some glitches. PR provides fixes and extra API for it.

When net_app_ctx has multiple net_contexts, selecting net_context
based on dst address has some glitches.

E.g. One net_app_ctx and two net_contexts (net_ctx1, net_ctx2).
     Both net_contexts are mapped to net_app_ctx.
     When a caller looking for net_ctx (e.g. net_ctx2) with
     matching dst address. Loop goes through net_ctx1 and dst
     doesn't match. But another if condition checks does this
     net_context mapped to net_app_ctx, yes it matches.
     So return net_ctx1, which is wrong.

So first go through all elements in array of net_contexts for
matching dst address, if it fails to find then go for matching
net_app_ctx.

Signed-off-by: Ravi kumar Veeramally <[email protected]>
Added a new API to get net pkt based on dst address. Destination
address will be used to find correct net_context.

Signed-off-by: Ravi kumar Veeramally <[email protected]>
@codecov-io
Copy link

Codecov Report

Merging #6073 into master will decrease coverage by <.01%.
The diff coverage is 19.04%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6073      +/-   ##
==========================================
- Coverage   52.63%   52.62%   -0.01%     
==========================================
  Files         410      410              
  Lines       40048    40060      +12     
  Branches     7781     7784       +3     
==========================================
+ Hits        21078    21081       +3     
- Misses      15768    15776       +8     
- Partials     3202     3203       +1
Impacted Files Coverage Δ
include/net/net_app.h 100% <ø> (ø) ⬆️
subsys/net/lib/app/net_app.c 20.26% <19.04%> (-0.12%) ⬇️
samples/philosophers/src/main.c 98.43% <0%> (+1.56%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update aa8850b...04a63ce. Read the comment docs.

@pfalcon
Copy link
Contributor

pfalcon commented Feb 9, 2018

No concerns from my side, by I guess only @jukkar can say if this is the change in the right direction.

@jukkar jukkar merged commit b22ab26 into zephyrproject-rtos:master Feb 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants