ipv4 & ipv6: remove_trailer() uses a positive size as parameter

Change-Id: Id7d009cfee7727afb8267703c22c467e5f636070
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3438
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
This commit is contained in:
Jérôme Duval 2020-11-29 19:58:43 +01:00
parent 7377c39855
commit b6e85f802d
2 changed files with 6 additions and 6 deletions

View File

@ -311,9 +311,9 @@ FragmentPacket::AddFragment(uint16 start, uint16 end, net_buffer* buffer,
gBufferModule->remove_header(buffer, previous->fragment.end - start);
start = previous->fragment.end;
}
if (next != NULL && next->fragment.start < end) {
TRACE(" remove trailer %d bytes", next->fragment.start - end);
gBufferModule->remove_trailer(buffer, next->fragment.start - end);
if (next != NULL && end > next->fragment.start) {
TRACE(" remove trailer %d bytes", end - next->fragment.start);
gBufferModule->remove_trailer(buffer, end - next->fragment.start);
end = next->fragment.start;
}

View File

@ -350,9 +350,9 @@ FragmentPacket::AddFragment(uint16 start, uint16 end, net_buffer* buffer,
gBufferModule->remove_header(buffer, previous->fragment.end - start);
start = previous->fragment.end;
}
if (next != NULL && next->fragment.start < end) {
TRACE(" remove trailer %d bytes", next->fragment.start - end);
gBufferModule->remove_trailer(buffer, next->fragment.start - end);
if (next != NULL && end > next->fragment.start) {
TRACE(" remove trailer %d bytes", end - next->fragment.start);
gBufferModule->remove_trailer(buffer, end - next->fragment.start);
end = next->fragment.start;
}