[riot-notifications] [RIOT-OS/RIOT] cc2420/gnrc_netif: Adds crc_valid to netif (#8276)

José Alamos notifications at github.com
Thu Jul 25 12:20:54 CEST 2019


jia200x commented on this pull request.



> @@ -90,7 +90,7 @@ static inline bool _already_received(gnrc_netif_t *netif,
 static gnrc_pktsnip_t *_recv(gnrc_netif_t *netif)
 {
     netdev_t *dev = netif->dev;
-    netdev_ieee802154_rx_info_t rx_info;
+    netdev_ieee802154_rx_info_t rx_info = { .crc_valid = 0 };

> It is also in general not save to assume the callee changes a value, so it should always be set if it is checked later. Just from a security perspective ;-).

In that case I think `memset` is cleaner, considering there might be more rx_info stuff. This is independent to the fact the driver should always set it if it support automatic CRC calculation

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/8276#discussion_r307223295
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190725/f3e7aeec/attachment.htm>


More information about the notifications mailing list