aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-sflow.c
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2013-12-12 17:32:22 +0000
committerAnders Broman <anders.broman@ericsson.com>2013-12-12 17:32:22 +0000
commit138ce6f204f782d256ddf6d8bfd6fac93a321ee5 (patch)
treecd4f6af21f179850f87d6b80e4cfa51c5cdd697b /epan/dissectors/packet-sflow.c
parentaad04d59638f03884228d8c6a735c67bda5f7a6f (diff)
Try to fix "initializer element is not computable at load time"
svn path=/trunk/; revision=53962
Diffstat (limited to 'epan/dissectors/packet-sflow.c')
-rw-r--r--epan/dissectors/packet-sflow.c29
1 files changed, 22 insertions, 7 deletions
diff --git a/epan/dissectors/packet-sflow.c b/epan/dissectors/packet-sflow.c
index 0023fbdb65..9e269d04cf 100644
--- a/epan/dissectors/packet-sflow.c
+++ b/epan/dissectors/packet-sflow.c
@@ -877,9 +877,12 @@ dissect_sflow_245_extended_switch(tvbuff_t *tvb, proto_tree *tree, gint offset)
/* extended router data, after the packet data */
static gint
dissect_sflow_245_extended_router(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset) {
- struct sflow_address_type addr_type = {hf_sflow_245_nexthop_v4, hf_sflow_245_nexthop_v6};
+ struct sflow_address_type addr_type;
- offset = dissect_sflow_245_address_type(tvb, pinfo, tree, offset, &addr_type, NULL);
+ addr_type.hf_addr_v4 = hf_sflow_245_nexthop_v4;
+ addr_type.hf_addr_v6 = hf_sflow_245_nexthop_v6;
+
+ offset = dissect_sflow_245_address_type(tvb, pinfo, tree, offset, &addr_type, NULL);
proto_tree_add_item(tree, hf_sflow_245_nexthop_src_mask, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
proto_tree_add_item(tree, hf_sflow_245_nexthop_dst_mask, tvb, offset, 4, ENC_BIG_ENDIAN);
@@ -895,8 +898,11 @@ dissect_sflow_5_extended_mpls_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree
proto_item *ti_in;
proto_tree *out_stack;
proto_item *ti_out;
+ struct sflow_address_type addr_type;
+
+ addr_type.hf_addr_v4 = hf_sflow_245_nexthop_v4;
+ addr_type.hf_addr_v6 = hf_sflow_245_nexthop_v6;
- struct sflow_address_type addr_type = {hf_sflow_245_nexthop_v4, hf_sflow_245_nexthop_v6};
offset = dissect_sflow_245_address_type(tvb, pinfo, tree, offset, &addr_type, NULL);
in_label_count = tvb_get_ntohl(tvb, offset);
@@ -937,8 +943,11 @@ dissect_sflow_5_extended_mpls_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree
/* extended NAT data */
static gint
dissect_sflow_5_extended_nat(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset) {
- struct sflow_address_type addr_type = {hf_sflow_245_ipv4_src,
- hf_sflow_245_ipv6_src};
+ struct sflow_address_type addr_type;
+
+ addr_type.hf_addr_v4 = hf_sflow_245_ipv4_src;
+ addr_type.hf_addr_v6 = hf_sflow_245_ipv6_src;
+
offset = dissect_sflow_245_address_type(tvb, pinfo, tree, offset, &addr_type, NULL);
addr_type.hf_addr_v4 = hf_sflow_245_ipv4_dst;
@@ -965,7 +974,10 @@ dissect_sflow_245_extended_gateway(tvbuff_t *tvb, packet_info *pinfo, proto_tree
/* sFlow v5 contains next hop router IP address */
if (version == 5) {
- struct sflow_address_type addr_type = {hf_sflow_245_nexthop_v4, hf_sflow_245_nexthop_v6};
+ struct sflow_address_type addr_type;
+
+ addr_type.hf_addr_v4 = hf_sflow_245_nexthop_v4;
+ addr_type.hf_addr_v6 = hf_sflow_245_nexthop_v6;
offset = dissect_sflow_245_address_type(tvb, pinfo, tree, offset, &addr_type, NULL);
}
@@ -2333,12 +2345,15 @@ dissect_sflow_245(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
proto_tree *sflow_245_tree;
guint32 version, sub_agent_id, seqnum;
struct sflow_address_details addr_details;
- struct sflow_address_type addr_type = {hf_sflow_agent_address_v4, hf_sflow_agent_address_v6};
+ struct sflow_address_type addr_type;
guint32 numsamples;
volatile guint offset = 0;
guint i = 0;
+ addr_type.hf_addr_v4 = hf_sflow_agent_address_v4;
+ addr_type.hf_addr_v6 = hf_sflow_agent_address_v6;
+
/*
* We fetch the version and address type so that we can determine,
* ahead of time, whether this is an sFlow packet or not, before