Skip to content

Commit 04205ae

Browse files
jukkarkartben
authored andcommitted
net: Set the protocol type of fragmented packet
The fragmented packet should inherit the protocol type of the original packet. Signed-off-by: Jukka Rissanen <[email protected]>
1 parent 3e68055 commit 04205ae

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

subsys/net/ip/ipv4_fragment.c

+2
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,8 @@ static int send_ipv4_fragment(struct net_pkt *pkt, uint16_t rand_id, uint16_t fi
441441
net_pkt_cursor_backup(pkt, &cur_pkt);
442442
net_pkt_cursor_backup(frag_pkt, &cur);
443443

444+
net_pkt_set_ll_proto_type(frag_pkt, net_pkt_ll_proto_type(pkt));
445+
444446
/* Copy the original IPv4 headers back to the fragment packet */
445447
if (net_pkt_copy(frag_pkt, pkt, net_pkt_ip_hdr_len(pkt))) {
446448
goto fail;

subsys/net/ip/ipv6_fragment.c

+2
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,8 @@ static int send_ipv6_fragment(struct net_pkt *pkt,
609609

610610
net_pkt_cursor_init(pkt);
611611

612+
net_pkt_set_ll_proto_type(frag_pkt, net_pkt_ll_proto_type(pkt));
613+
612614
/* We copy original headers back to the fragment packet
613615
* Note that we insert the right next header to point to fragment header
614616
*/

0 commit comments

Comments
 (0)