On Sun, 2015-10-11 at 16:42 +0530, punit vara wrote:
> following are the two structure need to be consider for alignment.
> 
> struct iw_pmksa {
> __u32                      cmd;                     /*     0     4 */
> struct sockaddr            bssid;                /*     4    16 */
> __u8                       pmkid[16];              /*    20    16 */

wrong bssid, bssid here is on the stack
after a char *, so bssid is aligned on a
pointer boundary, either 4 or 8.

> /* size: 36, cachelines: 1, members: 3 */
> /* last cacheline: 36 bytes */
> };
> 
> struct wlan_bssid_ex {
[]
> unsigned char              MacAddress[6];        /*     4     6 */

> As I understood both are not aligned to u16 so
> ether_addr_equal_unaligned() should be used.

u16s are aligned when on any even address

So ether_addr_equal could be used.


_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to