To avoid difficulties on older / stricter C compilers, this patch moves the variable definition to the beginning of the block in is_ipv4().
Found by Peter Stuge. Signed-off-by: Fabian Knittel <fabian.knit...@avona.com> --- proto.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/proto.c b/proto.c index 64486de..5a9d3a6 100644 --- a/proto.c +++ b/proto.c @@ -54,10 +54,10 @@ is_ipv4 (int tunnel_type, struct buffer *buf) return false; eh = (const struct openvpn_ethhdr *) BPTR (buf); if (ntohs (eh->proto) == OPENVPN_ETH_P_8021Q) { + const struct openvpn_8021qhdr *evh; if (BLEN (buf) < (int)(sizeof (struct openvpn_8021qhdr) + sizeof (struct openvpn_iphdr))) return false; - const struct openvpn_8021qhdr *evh; evh = (const struct openvpn_8021qhdr *) BPTR (buf); if (ntohs (evh->proto) != OPENVPN_ETH_P_IPV4) return false; -- 1.7.0