Skip to content

Commit

Permalink
Fix incorrect BW value with some clients
Browse files Browse the repository at this point in the history
Some SAT>IP clients send the parameter "bw" (DVB-T/C) in a incorrect range. The specifications indicate that acceptable values are: "5”, ”6”, “7”, “8", “10”, “1.712”. Therefore values like "bw=8000" or "bw=8000000" are incorrect. But we can handle them. In fact previously these requests will generate an overflow internaly in the value but the request will be served.

This patch fixes this recalculating incorrect values.
  • Loading branch information
lars18th authored and catalinii committed Jun 1, 2023
1 parent 964dd4a commit d787645
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/dvb.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,13 @@ int detect_dvb_parameters(char *s, transponder *tp) {
tp->gi = map_int(arg[i] + 3, fe_gi);
if (strncmp("tmode=", arg[i], 6) == 0)
tp->tmode = map_int(arg[i] + 6, fe_tmode);
if (strncmp("bw=", arg[i], 3) == 0)
if (strncmp("bw=", arg[i], 3) == 0) {
tp->bw = map_float(arg[i] + 3, 1000000);
if (tp->bw < 0 || tp->bw > 100000000) // Fix clients that send bw=8000 !
tp->bw = map_float(arg[i] + 3, 1000);
if (tp->bw < 0 || tp->bw > 100000000) // Fix clients that send bw=8000000 !
tp->bw = map_float(arg[i] + 3, 1);
}
if (strncmp("specinv=", arg[i], 8) == 0)
tp->inversion = map_int(arg[i] + 8, NULL);
if (strncmp("c2tft=", arg[i], 6) == 0)
Expand Down

0 comments on commit d787645

Please sign in to comment.