Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

[issue1522400] irda socket support

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

Apr 11, 2012, 4:18 AM

Post #1 of 7 (142 views)
Permalink
[issue1522400] irda socket support

Changes by Martin v. Löwis <martin [at] v>:


----------
stage: needs patch -> patch review

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue1522400>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Apr 11, 2012, 6:39 AM

Post #2 of 7 (134 views)
Permalink
[issue1522400] irda socket support [In reply to]

Changes by Antoine Pitrou <pitrou [at] free>:


----------
nosy: +neologix

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue1522400>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Apr 24, 2012, 1:00 PM

Post #3 of 7 (129 views)
Permalink
[issue1522400] irda socket support [In reply to]

Charles-François Natali <neologix [at] free> added the comment:

Here's a cleanup up patch against default.
However, I don't have any IrDA capable device neither, so I won't be
able to help much. I'll ask on python-dev if someone can help.
As for the manual decoding, AFAICT you'll have the same issue with CAN sockets.
The real question is really "how high-level should the socket module be?".
Because if we added let's say and IRDASocket type, then we could
easily add helper functions to and methods to e.g. list available IrDA
devices, decode fields, etc.
Same thing holds for CAN sockets, and one could imagine we could also
maybe add a MulticastSocket that would make joining/leaving a
multicast group easy (because it is a pain), etc.

----------
Added file: http://bugs.python.org/file25349/irda-default.diff

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue1522400>
_______________________________________
Attachments: irda-default.diff (4.84 KB)


report at bugs

Apr 25, 2012, 12:34 PM

Post #4 of 7 (129 views)
Permalink
[issue1522400] irda socket support [In reply to]

Gregory P. Smith <greg [at] krypto> added the comment:

Your updated patch looks fine to me. I don't see any reason not to commit it and mention it in the release notes. If it has bugs, they can be discovered and fixed later by people with actual relevant hardware an interest.

----------
nosy: +gregory.p.smith

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue1522400>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Apr 25, 2012, 1:57 PM

Post #5 of 7 (129 views)
Permalink
[issue1522400] irda socket support [In reply to]

Charles-François Natali <neologix [at] free> added the comment:

Actually I think it suffers from the same problem as AF_UNIX: sockaddr_irda->sir_name, like sockaddr_un->sun_path, don't have to be NUL-terminated, and the kernel can return non NUL-terminated strings.
Which means that such code:
{
/* regular NULL-terminated string */
return PyUnicode_DecodeFSDefault(a->sun_path);
}

or

return Py_BuildValue("iO&", a->sir_addr,
PyUnicode_DecodeFSDefault, a->sir_name);


can overrung pas sun_path/sir_name, and potentially segfault.
See http://bugs.python.org/issue8372.

What's the simplest way to account for this?
Is there a way to pass PyUnicode_DecodeFSDefault a max length (without having to make an intermediary copy or sir_name, appending a NUL at the end)?

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue1522400>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Apr 30, 2012, 12:44 AM

Post #6 of 7 (124 views)
Permalink
[issue1522400] irda socket support [In reply to]

Charles-François Natali <neologix [at] free> added the comment:

> Actually I think it suffers from the same problem as AF_UNIX:
> sockaddr_irda->sir_name, like sockaddr_un->sun_path, don't have to be
> NUL-terminated, and the kernel can return non NUL-terminated strings.

Actually, I've had a look at the Linux and Windows documentation, and sir_name is NUL-terminated. I've also had a look at the kernel source, and it treats sir_name as NUL-terminated, so it should be safe.

Here's a new patch, with a couple new constants, documentation update and some - really basic - tests.
I guess Gregory is right, and we could push this as-is, and wait until some users is interested in improving the support and tests.

----------
keywords: +needs review

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue1522400>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Apr 30, 2012, 12:45 AM

Post #7 of 7 (126 views)
Permalink
[issue1522400] irda socket support [In reply to]

Changes by Charles-François Natali <neologix [at] free>:


Added file: http://bugs.python.org/file25415/irda-default-1.diff

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue1522400>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.