Skip to content

Commit

Permalink
New PIDS_ALL emulation with NULLs (#828)
Browse files Browse the repository at this point in the history
Instead of using two list, this code now adds the NULL (8191) pid when it's necessary
  • Loading branch information
lars18th committed Apr 9, 2021
1 parent 8b6d9dd commit 58d1570
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/minisatip.h
Expand Up @@ -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[]);

Expand Down
10 changes: 6 additions & 4 deletions src/pmt.c
Expand Up @@ -1952,17 +1952,19 @@ 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",
__FUNCTION__, fpid);
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);
Expand Down

3 comments on commit 58d1570

@9000h
Copy link
Collaborator

@9000h 9000h commented on 58d1570 Apr 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like the compile is broken now

pmt.c: In function ‘emulate_add_all_pids’:
pmt.c:1955:17: error: conflicting types for ‘forced_pids’
             int forced_pids[] = {EMU_PIDS_ALL_ENFORCED_PIDS_LIST};
                 ^~~~~~~~~~~
pmt.c:1954:18: note: previous declaration of ‘forced_pids’ was here
             int *forced_pids;
                  ^~~~~~~~~~~
pmt.c:1956:29: error: ‘i_forced’ undeclared (first use in this function); did you mean ‘ifreq’?
             for (j = 0; j < i_forced; j++) {
                             ^~~~~~~~
                             ifreq
pmt.c:1956:29: note: each undeclared identifier is reported only once for each function it appears in

@atvcaptain
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

build issue

| pmt.c: In function 'emulate_add_all_pids':
| pmt.c:1955:17: error: conflicting types for 'forced_pids'
| 1955 | int forced_pids[] = {EMU_PIDS_ALL_ENFORCED_PIDS_LIST};
| | ^~~~~~~~~~~
| pmt.c:1954:18: note: previous declaration of 'forced_pids' was here
| 1954 | int *forced_pids;
| | ^~~~~~~~~~~
| pmt.c:1956:29: error: 'i_forced' undeclared (first use in this function)
| 1956 | for (j = 0; j < i_forced; j++) {

@catalinii
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Please sign in to comment.