nfqws: cosmetic

This commit is contained in:
bol-van 2021-05-26 09:26:39 +03:00
parent 1c0ef31e3a
commit 9a354ee972

View File

@ -257,7 +257,7 @@ static int nfq_main()
goto exiterr; goto exiterr;
do do
{ {
while ((rv = recv(fd, buf, sizeof(buf), 0)) && rv >= 0) while ((rv = recv(fd, buf, sizeof(buf), 0)) > 0)
{ {
dohup(); dohup();
int r = nfq_handle_packet(h, buf, rv); int r = nfq_handle_packet(h, buf, rv);
@ -268,7 +268,7 @@ static int nfq_main()
// do not fail on ENOBUFS // do not fail on ENOBUFS
} while(errno==ENOBUFS); } while(errno==ENOBUFS);
printf("unbinding from queue 0\n"); printf("unbinding from queue %u\n", params.qnum);
nfq_destroy_queue(qh); nfq_destroy_queue(qh);
#ifdef INSANE #ifdef INSANE
@ -431,7 +431,7 @@ exiterr:
static bool parse_scale_factor(char *s, uint16_t *wsize, uint8_t *wscale) static bool parse_ws_scale_factor(char *s, uint16_t *wsize, uint8_t *wscale)
{ {
int v; int v;
char *p; char *p;
@ -660,11 +660,11 @@ int main(int argc, char **argv)
} }
break; break;
case 6: /* wsize */ case 6: /* wsize */
if (!parse_scale_factor(optarg,&params.wsize,&params.wscale)) if (!parse_ws_scale_factor(optarg,&params.wsize,&params.wscale))
exit_clean(1); exit_clean(1);
break; break;
case 7: /* wssize */ case 7: /* wssize */
if (!parse_scale_factor(optarg,&params.wssize,&params.wsscale)) if (!parse_ws_scale_factor(optarg,&params.wssize,&params.wsscale))
exit_clean(1); exit_clean(1);
break; break;
case 8: /* wssize-cutoff */ case 8: /* wssize-cutoff */