Skip to content

Commit 8df8606

Browse files
committed
Trim skb linear data
Temporary fix for case when headers starts in skblinear data Fixed pointer to frame header for 304 response
1 parent eccfb1e commit 8df8606

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

fw/cache.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -849,6 +849,8 @@ tfw_cache_send_304(TfwHttpReq *req, TfwCacheEntry *ce)
849849
r = tfw_h2_resp_status_write(resp, 304, false, true);
850850
if (unlikely(r))
851851
goto err_setup;
852+
853+
resp->mit.frame_head = it->skb_head->data;
852854
}
853855

854856
/* Put 304 headers */

fw/http_msg.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1517,7 +1517,8 @@ tfw_h2_msg_cutoff_headers(TfwHttpResp *resp, TfwHttpRespCleanup* cleanup)
15171517

15181518
if ((begin <= off) && (end >= off)) {
15191519
it->frag = -1;
1520-
/* TODO: Handle this case, most likely for low MTU*/
1520+
/* TODO: Handle this case, most likely for low MTU
1521+
* it will be implemented as part of #1703 */
15211522
return;
15221523
}
15231524
}
@@ -1566,6 +1567,10 @@ tfw_h2_msg_cutoff_headers(TfwHttpResp *resp, TfwHttpRespCleanup* cleanup)
15661567
(si->nr_frags) * sizeof(skb_frag_t));
15671568
}
15681569

1570+
/* Trim skb linear data. This is ugly hotfix and must be removed after
1571+
* implementation of #1703 */
1572+
it->skb->len -= skb_headlen(it->skb);
1573+
15691574
it->skb_head = it->skb;
15701575
resp->msg.skb_head = it->skb;
15711576

0 commit comments

Comments
 (0)