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

Use all space in allocated skbs #1189

Closed
vankoven opened this issue Feb 15, 2019 · 0 comments
Closed

Use all space in allocated skbs #1189

vankoven opened this issue Feb 15, 2019 · 0 comments
Assignees
Milestone

Comments

@vankoven
Copy link
Contributor

Noticed by @aleksostapenko in #1162 (comment)

It seems that there is a problem with using skb header when allocating more than one skb - in tfw_http_msg_setup() each skb is allocated with a place under the header:

struct sk_buff *skb = alloc_skb(MAX_TCP_HEADER + n, GFP_ATOMIC);

but in tfw_msg_write() only the header of the first skb in list is used (it->frag < 0):
} else {

for subsequent skb it-> frag is always initialized to zero:

so then we always fall into the it->frag >= 0 branch.
Looks like the current master version of tfw_msg_write() has the same issue.

@vankoven vankoven self-assigned this Feb 15, 2019
@vankoven vankoven added this to the 0.6 Tempesta TLS milestone Feb 15, 2019
vankoven added a commit that referenced this issue Mar 11, 2019
…aged fragments

ss_skb_frag_next() is always work with TfwMsgIter, so renamed and moved
into msg.h, the whole TfwMsgIter became invalid if the function fails.
vankoven added a commit that referenced this issue Mar 13, 2019
* Don't create linear skb part for huge messages, it's easier to walk
over them using TfwMsgIter
* ss_skb_frag_next() is always work with TfwMsgIter, so renamed and moved
into msg.h.
* tfw_http_msg_add_data() and tfw_msg_write() are very similar functions,
unify them
vankoven added a commit that referenced this issue Mar 26, 2019
fix #1189: correctly fill header part of skb when writing data into p…
avbelov23 pushed a commit that referenced this issue Jul 2, 2019
…aged fragments

ss_skb_frag_next() is always work with TfwMsgIter, so renamed and moved
into msg.h, the whole TfwMsgIter became invalid if the function fails.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants