Message ID | 1437616850-23266-36-git-send-email-kamal@canonical.com |
---|---|
State | New |
Headers | show |
diff --git a/net/ieee802154/dgram.c b/net/ieee802154/dgram.c index 1865fdf..2bdd0cc 100644 --- a/net/ieee802154/dgram.c +++ b/net/ieee802154/dgram.c @@ -313,6 +313,12 @@ static int dgram_recvmsg(struct kiocb *iocb, struct sock *sk, sock_recv_ts_and_drops(msg, sk, skb); if (saddr) { + /* Clear the implicit padding in struct sockaddr_ieee802154 + * (16 bits between 'family' and 'addr') and in struct + * ieee802154_addr_sa (16 bits at the end of the structure). + */ + memset(saddr, 0, sizeof(*saddr)); + saddr->family = AF_IEEE802154; saddr->addr = mac_cb(skb)->sa; *addr_len = sizeof(*saddr);