Closed vlrpl closed 1 year ago
Any practical cases (you encountered) this fixes?
Apart from the small comment, LGTM.
Not really. AFAICT, more than one scratch memory location (assuming the first used is always M[0]) should be used for not that common filters. In my case, I realized the size was missing using "protochain GRE" while doing some experiments with the jump back generated by pcap_compile().
Any practical cases (you encountered) this fixes? Apart from the small comment, LGTM.
Not really. AFAICT, more than one scratch memory location (assuming the first used is always M[0]) should be used for not that common filters. In my case, I realized the size was missing using "protochain GRE" while doing some experiments with the jump back generated by pcap_compile().
e.g. a random filter like:
"(udp src port 53) or (vlan and tcp src port 80) or (icmp[icmptype] == icmp-echoreply && icmp[4:2] == 0xffdc)"
doesn't use M[] to st/ld data.
k is an offset inside a scratch area of 16 entries, 4 bytes-sized each. Apparently, the size slipped out. Fix it by taking it into account.