Skip to content

Commit

Permalink
Merge pull request #537 from jjnicola/pcap-filter
Browse files Browse the repository at this point in the history
Print the filter used by pcap in the error message.
  • Loading branch information
jjnicola committed Jul 2, 2020
2 parents a97df29 + 9e10bfa commit ebc2deb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Add extended environmental variables info to greenbone-nvt-sync help text. [#488](https://github.com/greenbone/openvas/pull/488)
- Extend nasl functions which generate results with optional "uri" parameter [#526](https://github.com/greenbone/openvas/pull/526)
- Add nasl function to get the host kb index. [#530](https://github.com/greenbone/openvas/pull/530)
- Print the filter used by pcap in the error message.[#537](https://github.com/greenbone/openvas/pull/537)

### Changed
- The logging of the NASL internal regexp functions was extended to include the pattern in case of a failed regcomp(). [#397](https://github.com/greenbone/openvas/pull/397)
Expand Down
4 changes: 3 additions & 1 deletion misc/bpf_share.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ bpf_open_live (char *iface, char *filter)

if (pcap_compile (ret, &filter_prog, filter, 1, netmask) < 0)
{
print_pcap_error (ret, "pcap_compile");
char buffer[2048];
snprintf (buffer, sizeof (buffer), "pcap_compile: Filter \"%s\"", filter);
print_pcap_error (ret, buffer);
pcap_close (ret);
return -1;
}
Expand Down

0 comments on commit ebc2deb

Please sign in to comment.