In gen_byteop() the "=", "<" and ">" cases load the required packet byte
into the A register implicitly via gen_load_a(), but the other two cases
need to do it explicitly, otherwise A will hold the previous value and
the ALU instruction will take that as the input.
The bug was introduced in the tcpdump 2.0 release (January 1991, before
libpcap 0.0), which replaced filter.c with gencode.c.
Require "(iso|isis) proto" values to be within valid ranges.
Use the correct IS-IS PDU type offset for DLT_C_HDLC.
Use the correct bit mask for IS-IS PDU type value.
+ Fix the "|" and "&" operators of the "byte" primitive.
rpcap:
Support user names and passwords in rpcap:// and rpcaps:// URLs.
Add a -t flag to rpcapd to specify the data channel port; from
break;
}
s->s.k = val;
+ // Load the required byte first.
+ struct slist *s0 = gen_load_a(cstate, OR_LINKHDR, idx, BPF_B);
+ sappend(s0, s);
b = new_block(cstate, JMP(BPF_JEQ));
- b->stmts = s;
+ b->stmts = s0;
gen_not(b);
return b;
DLT => 'IPV4',
aliases => ['byte 8 | 5'],
unopt => '
- (000) or #0x5
- (001) jeq #0x0 jt 2 jf 3
- (002) ret #0
- (003) ret #262144
+ (000) ldb [8]
+ (001) or #0x5
+ (002) jeq #0x0 jt 3 jf 4
+ (003) ret #0
+ (004) ret #262144
',
}, # byte_or
{
DLT => 'IPV4',
aliases => ['byte 8 & 5'],
unopt => '
- (000) and #0x5
- (001) jeq #0x0 jt 2 jf 3
- (002) ret #0
- (003) ret #262144
+ (000) ldb [8]
+ (001) and #0x5
+ (002) jeq #0x0 jt 3 jf 4
+ (003) ret #0
+ (004) ret #262144
',
}, # byte_and
);