Skip to content

Commit 52638a0

Browse files
vaussardcfriedt
authored andcommitted
net: ipv6_fragment: send ICMPv6 Time Exceeded upon reassembly timeout
RFC 2460 Sec. 5 requires that a ICMPv6 Time Exceeded message is sent upon reassembly timeout, if we received the first fragment (i.e. the one with a Fragment Offset of zero). Implement this requirement. Signed-off-by: Florian Vaussard <[email protected]>
1 parent c66b428 commit 52638a0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

subsys/net/ip/ipv6_fragment.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,11 @@ static void reassembly_timeout(struct k_work *work)
219219

220220
reassembly_info("Reassembly cancelled", reass);
221221

222+
/* Send a ICMPv6 Time Exceeded only if we received the first fragment (RFC 2460 Sec. 5) */
223+
if (reass->pkt[0] && net_pkt_ipv6_fragment_offset(reass->pkt[0]) == 0) {
224+
net_icmpv6_send_error(reass->pkt[0], NET_ICMPV6_TIME_EXCEEDED, 1, 0);
225+
}
226+
222227
reassembly_cancel(reass->id, &reass->src, &reass->dst);
223228
}
224229

0 commit comments

Comments
 (0)