[New-bugs-announce] [issue13045] [PATCH] socket.getsockopt may require custom buffer contents

Artyom Gavrichenkov report at bugs.python.org
Sun Sep 25 19:12:20 CEST 2011


New submission from Artyom Gavrichenkov <ximaera at highloadlab.com>:

Currently the Python implementation of socket.getsockopt allows only option name, level name and buffer size as its arguments. However, IEEE Standard 1003.1-2008 allows one further argument -- an actual buffer to modify at the kernel level. POSIX does not prohibit the kernel from reading this buffer before modification, and the contents of the buffer may be used together with option and level names to specify an exact socket option to return.

In fact, this is how some applications already work, ipset (http://ipset.netfilter.org/) being a noticeable example.

The patch, written against Python 3.2 and aiming at providing this functionality, is attached. It may also apply to previous Python versions, though it's not tested against anything except Python 3.2.

----------
components: Extension Modules
files: getsockopt_buffer_input.patch
keywords: patch
messages: 144526
nosy: Artyom.Gavrichenkov
priority: normal
severity: normal
status: open
title: [PATCH] socket.getsockopt may require custom buffer contents
type: feature request
versions: Python 3.2
Added file: http://bugs.python.org/file23243/getsockopt_buffer_input.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13045>
_______________________________________


More information about the New-bugs-announce mailing list