This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients devnexen, koobs, vstinner
Date 2022-01-12.21:43:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1642023827.35.0.377347113445.issue46357@roundup.psfhosted.org>
In-reply-to
Content
> Solves the "Make sure new member of socket address initialized." warning for the bluetooth sockaddr_l2cap usage.

You would to elaborate how you checked that all members of the socket address are initialized? Which socketmodule.c functions use this type? Are all members initialized?

https://www.leidinger.net/FreeBSD/dox/netgraph/html/d2/de3/structsockaddr__l2cap.html

A quick search points me to:
https://www.leidinger.net/FreeBSD/dox/netgraph/html/d2/de3/structsockaddr__l2cap.html
---
u_char 	l2cap_len 
u_char 	l2cap_family 
u_int16_t 	l2cap_psm 
bdaddr_t 	l2cap_bdaddr 
u_int16_t 	l2cap_cid 
u_int8_t 	l2cap_bdaddr_type
---

In BTPROTO_L2CAP case of getsockaddrarg(), it seems like only l2cap_family and l2cap_bdaddr are set, other members are set to 0. Is it enough? It seems like the important call is:

memset(addr, 0, sizeof(struct sockaddr_l2));

On FreeBSD, socketmodule.c uses:

#define sockaddr_l2 sockaddr_l2cap
History
Date User Action Args
2022-01-12 21:43:47vstinnersetrecipients: + vstinner, koobs, devnexen
2022-01-12 21:43:47vstinnersetmessageid: <1642023827.35.0.377347113445.issue46357@roundup.psfhosted.org>
2022-01-12 21:43:47vstinnerlinkissue46357 messages
2022-01-12 21:43:47vstinnercreate