Skip to content

Commit 9bbdc7f

Browse files
libipt: update sync offset at PSB
We currently update the sync offset only at explicit synchronization requests, not while we are processing PSB during decode. We used to start backward synchronization at the previous synchronization point, so we couldn't update the sync offset during decode. This changed already some time ago to start at the current position. Update the sync offset at PSB during decode. This allows re-synchronizing at the current PSB segment using pt_*_get_sync_offset() followed by ps_*_sync_set() Signed-off-by: Markus Metzger <[email protected]>
1 parent 7e0d47a commit 9bbdc7f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

libipt/src/pt_packet_decoder.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,15 +266,19 @@ static int pt_pkt_decode_pad(struct pt_packet_decoder *decoder,
266266
static int pt_pkt_decode_psb(struct pt_packet_decoder *decoder,
267267
struct pt_packet *packet)
268268
{
269+
const uint8_t *pos;
269270
int size;
270271

271272
if (!decoder)
272273
return -pte_internal;
273274

274-
size = pt_pkt_read_psb(decoder->pos, &decoder->config);
275+
pos = decoder->pos;
276+
size = pt_pkt_read_psb(pos, &decoder->config);
275277
if (size < 0)
276278
return size;
277279

280+
decoder->sync = pos;
281+
278282
packet->type = ppt_psb;
279283
packet->size = (uint8_t) size;
280284

0 commit comments

Comments
 (0)