From 58d15703aff6fd037d3c2a07350a290244d62fff Mon Sep 17 00:00:00 2001 From: Lars The Date: Fri, 9 Apr 2021 08:12:54 +0200 Subject: [PATCH] New PIDS_ALL emulation with NULLs (#828) Instead of using two list, this code now adds the NULL (8191) pid when it's necessary --- src/minisatip.h | 1 - src/pmt.c | 10 ++++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/minisatip.h b/src/minisatip.h index 61d1ae9d7e..381bf76a04 100644 --- a/src/minisatip.h +++ b/src/minisatip.h @@ -12,7 +12,6 @@ #endif #define EMU_PIDS_ALL_ENFORCED_PIDS_LIST 1, 16, 17, 18, 20, 21 -#define EMU_PIDS_ALL_ENFORCED_WITH_NULL 1, 16, 17, 18, 20, 21, 8191 void set_options(int argc, char *argv[]); diff --git a/src/pmt.c b/src/pmt.c index ce26091c72..3ac7e00798 100644 --- a/src/pmt.c +++ b/src/pmt.c @@ -1952,10 +1952,7 @@ void emulate_add_all_pids(adapter *ad) { } int *forced_pids; - int list_plain[] = {EMU_PIDS_ALL_ENFORCED_PIDS_LIST}; - int list_with_null[] = {EMU_PIDS_ALL_ENFORCED_WITH_NULL}; - forced_pids = (ad->drop_encrypted) ? list_plain : list_with_null; - int i_forced = sizeof(forced_pids) / sizeof(int); + int forced_pids[] = {EMU_PIDS_ALL_ENFORCED_PIDS_LIST}; for (j = 0; j < i_forced; j++) { int fpid = forced_pids[j]; LOG("%s: adding (enforced) pid %d to emulate all pids", @@ -1963,6 +1960,11 @@ void emulate_add_all_pids(adapter *ad) { mark_pid_add(p_all->sid[i], ad->id, fpid); updated = 1; } + if (!ad->drop_encrypted) { + LOG("%s: adding (enforced) pid 8191 (NULL) too", + __FUNCTION__); + mark_pid_add(p_all->sid[i], ad->id, 8191); + } } if (updated) update_pids(ad->id);