Wireshark-dev: Re: [Wireshark-dev] packet-lorawan.c compile error because of stuff added yester
From: Pascal Quantin <pascal.quantin@xxxxxxxxx>
Date: Tue, 13 Jun 2017 22:33:29 +0200
Hi Richard,

2017-06-13 22:29 GMT+02:00 Richard Sharpe <realrichardsharpe@xxxxxxxxx>:
Hi folks,

After I did a git pull, I started getting this error:

  CC       packet-lorawan.lo
packet-lorawan.c: In function 'dissect_lorawan':
packet-lorawan.c:657:7: error: variable 'frame_length' set but not
used [-Werror=unused-but-set-variable]
  gint frame_length;

Seems to be related to this:

        frame_length = current_offset;
+#if GCRYPT_VERSION_NUMBER >= 0x010600 /* 1.6.0 */
        if (encryption_keys) {
                guint8 *msg = (guint8
*)wmem_alloc0(wmem_packet_scope(), frame_length + 16);
                msg[0] = 0x49;
@@ -824,7 +833,9 @@ dissect_lorawan(tvbuff_t *tvb, packet_info *pinfo,
proto_tree *tree _U_, void *d
                if (calculate_mic(msg, frame_length + 16,
encryption_keys->nwkskey->data) != tvb_get_guint32(tvb,
current_offset, ENC_LITTLE_ENDIAN)) {
                        proto_tree_add_expert_format(lorawan_tree,
pinfo, &ei_lorawan_invalid_crc, tvb, current_offset, 4, "Invalid
CRC");
                }
-       } else {
+       } else
+#endif
+       {

It's a bit rude to cause build errors just because I don't have gcrypt
1.6.0 or above.

This is currently under process: https://code.wireshark.org/review/#/c/22098

Pascal.