bind on AF_BLUETOOTH will always produce: ==8721== Syscall param socketcall.bind(my_addr.) points to uninitialised byte(s) ==8721== at 0x318A2F3187: bind (syscall-template.S:81) ==8721== by 0x400639: main (rfcomm.c:51) Because sockaddr_rc has some padding which isn't used, but might not be initialized. Reproducible: Always
Created attachment 80013 [details] Support-Linux-kernel-AF_BLUETOOTH-for-bind.patch Support Linux kernel AF_BLUETOOTH for bind(). Bug #320116. sockaddr_rc might contain some padding which might not be initialized. Explicitly check the sockaddr_rc fields are set. That also produces better diagnostics about which field is unitialized.
I committed this as r13404. Plus extra fix for platforms without AF_BLUETOOTH spotted by Tom Hughes as r13405.