1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-31 20:09:02 +00:00

Update to libpcap 1.9.1 (initial commit, no Nmap-specific patches)

This commit is contained in:
dmiller
2019-11-19 17:53:36 +00:00
parent 42bb2feed8
commit f1107301e8
125 changed files with 7238 additions and 13624 deletions

View File

@@ -51,7 +51,7 @@
#include <sys/time.h>
#endif /* _WIN32 */
#include <pcap/bpf.h>
#include <pcap-int.h>
#include <stdlib.h>
@@ -328,11 +328,17 @@ bpf_filter_with_aux_data(const struct bpf_insn *pc, const u_char *p,
continue;
case BPF_ALU|BPF_LSH|BPF_X:
A <<= X;
if (X < 32)
A <<= X;
else
A = 0;
continue;
case BPF_ALU|BPF_RSH|BPF_X:
A >>= X;
if (X < 32)
A >>= X;
else
A = 0;
continue;
case BPF_ALU|BPF_ADD|BPF_K:
@@ -378,10 +384,13 @@ bpf_filter_with_aux_data(const struct bpf_insn *pc, const u_char *p,
case BPF_ALU|BPF_NEG:
/*
* Most BPF arithmetic is unsigned, but negation
* can't be unsigned; throw some casts to
* specify what we're trying to do.
* can't be unsigned; respecify it as subtracting
* the accumulator from 0U, so that 1) we don't
* get compiler warnings about negating an unsigned
* value and 2) don't get UBSan warnings about
* the result of negating 0x80000000 being undefined.
*/
A = (u_int32)(-(int32)A);
A = (0U - A);
continue;
case BPF_MISC|BPF_TAX: