Skip to content
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

net: ip: net_pkt: Fix net_pkt_pull data buffer corruption #22335

Merged
merged 2 commits into from
Feb 3, 2020
Merged

net: ip: net_pkt: Fix net_pkt_pull data buffer corruption #22335

merged 2 commits into from
Feb 3, 2020

Conversation

a8961713
Copy link
Contributor

Fixes #22307

@zephyrbot zephyrbot added area: Networking area: Tests Issues related to a particular existing or missing test labels Jan 30, 2020
Copy link
Collaborator

@tbursztyka tbursztyka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like you inverted the commit messages and the actual patches

@a8961713
Copy link
Contributor Author

looks like you inverted the commit messages and the actual patches

You are correct. I'll resubmit.

Copy link
Member

@jukkar jukkar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, some minor nits.

subsys/net/ip/net_pkt.c Show resolved Hide resolved
tests/net/net_pkt/src/main.c Show resolved Hide resolved
@a8961713 a8961713 requested a review from jukkar January 30, 2020 12:53
Copy link
Contributor

@pfalcon pfalcon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo.

zassert_mem_equal(pkt_data_readback,
&pkt_data[PULL_AMOUNT],
PULL_TEST_PKT_DATA_SIZE - PULL_AMOUNT,
"Pakcet data changed");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: "Pakcet".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed, resubmitted.

Changed size related variables type to size_t to handle
large packet buffers correctly

Signed-off-by: David D <a8961713@gmail.com>
Added a test case for net_pkt_pull() with large packet buffers

Signed-off-by: David D <a8961713@gmail.com>
@a8961713 a8961713 requested a review from pfalcon February 2, 2020 04:36
@jukkar jukkar merged commit b45b1e3 into zephyrproject-rtos:master Feb 3, 2020
@a8961713 a8961713 deleted the fix_packet_pull_corruption branch February 4, 2020 04:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Networking area: Tests Issues related to a particular existing or missing test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

net: ip: net_pkt_pull(): packet corruption when using CONFIG_NET_BUF_DATA_SIZE larger than 256
5 participants