Break up the expression and use a local variable.
Signed-off-by: Andy Grover <[email protected]>
---
iscsiuio/src/unix/nic.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/iscsiuio/src/unix/nic.c b/iscsiuio/src/unix/nic.c
index e00e8f2..d56a9da 100644
--- a/iscsiuio/src/unix/nic.c
+++ b/iscsiuio/src/unix/nic.c
@@ -999,11 +999,13 @@ int process_packets(nic_t *nic,
vlan_id = pkt->vlan_tag & 0xFFF;
if ((vlan_id == 0) ||
(NIC_VLAN_STRIP_ENABLED & nic->flags)) {
- type = ntohs(ETH_BUF(pkt->buf)->type);
+ struct uip_eth_hdr *hdr = ETH_BUF(pkt->buf);
+ type = ntohs(hdr->type);
pkt->network_layer = pkt->data_link_layer +
sizeof(struct uip_eth_hdr);
} else {
- type = ntohs(VLAN_ETH_BUF(pkt->buf)->type);
+ struct uip_vlan_eth_hdr *hdr = VLAN_ETH_BUF(pkt->buf);
+ type = ntohs(hdr->type);
pkt->network_layer = pkt->data_link_layer +
sizeof(struct uip_vlan_eth_hdr);
}
--
1.9.3
--
You received this message because you are subscribed to the Google Groups
"open-iscsi" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/open-iscsi.
For more options, visit https://groups.google.com/d/optout.