From 8d146f0b768705d7e535cd31f642a9dd50b45ae9 Mon Sep 17 00:00:00 2001 From: Vitaliy Tomin Date: Wed, 27 Oct 2021 14:59:58 +0800 Subject: [PATCH] Fixed seq_next function * fixed kernel warnings like: [42959.649865] seq_file: buggy .next function mpeg2ts_seq_next [xt_mpeg2ts] did not update position index [42959.649878] seq_file: buggy .next function mpeg2ts_seq_next [xt_mpeg2ts] did not update position index [42959.649891] seq_file: buggy .next function mpeg2ts_seq_next [xt_mpeg2ts] did not update position index --- iptables-module/xt_mpeg2ts.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iptables-module/xt_mpeg2ts.c b/iptables-module/xt_mpeg2ts.c index b9f2770..f5effb7 100644 --- a/iptables-module/xt_mpeg2ts.c +++ b/iptables-module/xt_mpeg2ts.c @@ -1310,8 +1310,8 @@ static void *mpeg2ts_seq_next(struct seq_file *s, void *v, loff_t *pos) bucket = kmalloc(sizeof(unsigned int), GFP_ATOMIC); if (!bucket) return ERR_PTR(-ENOMEM); - *bucket = 0; - *pos = 0; + *bucket = 1; + *pos = 1; v = bucket; return bucket; }