]> The Tcpdump Group git mirrors - libpcap/commit
Fix building without protochain support. (GH #852)
authorDenis Ovsienko <[email protected]>
Tue, 14 Jun 2022 20:24:28 +0000 (21:24 +0100)
committerDenis Ovsienko <[email protected]>
Tue, 14 Jun 2022 20:36:51 +0000 (21:36 +0100)
commitbc594f185299d9d4e3b39ba94e91a5b9ca8a938d
tree0ec717de2202cde121d3ffd81d04cb0d3dccc20e
parente6129d599345f9fc9bd2352fda902322d7c24b82
Fix building without protochain support. (GH #852)

The NO_PROTOCHAIN macro is properly managed by both of the current build
systems, but it looks like noone has exercised the option in a long
time, as the source code compiles only with the default "enable
protochain" setting and the other branch fails due to a compiler error:

./configure --disable-protochain && make
[...]
./gencode.c: In function 'gen_protochain':
./gencode.c:6077:9: error: too few arguments to function 'gen_proto'
 6077 |  return gen_proto(cstate, v, proto);

Drop the offending call to gen_proto() because it is out of place anyway
and make both the declarations and the invocations of gen_protochain()
conditional on NO_PROTOCHAIN to emphasize that when the macro is
defined, the code is not reachable because the parser rejects the
"protochain" token at an earlier step.

./configure --disable-protochain && make
[...]
$ tcpdump -y EN10MB -d 'ip protochain \tcp'
tcpdump: protochain not supported
CHANGES
gencode.c