Skip to content

"Invalid parameter" when opening interface socket on devices with low rmem_max #41

@sm-Fifteen

Description

@sm-Fifteen

When creating a new socket to claim an interface, pyric uses a default value for tx and rx BUFSZ of 32768 bytes. It also checks that the selected value is smaller than the configured maximum socket buffer size, but since BUFSZ is hardcoded, said default value may cause socket initialization to fail. I'm currently working on an embedded system where rmem_max is 163840, which puts the output of _maxbufsz_ at 8192.

Out of the box, this is what I get :

Traceback (most recent call last):
  File "./test_iw.py", line 5, in <module>
    iface = pyw.getcard('wlan0')
  File "/usr/lib/python2.7/site-packages/pyric/pyw.py", line 269, in getcard
    if nlsock is None: return _nlstub_(getcard, dev)
  File "/usr/lib/python2.7/site-packages/pyric/pyw.py", line 2238, in _nlstub_
    raise pyric.error(e.errno, pyric.strerror(e.errno))
pyric.error: [Errno 22] Invalid parameter

It's also not very helpful how _nlstub_ swallows any errors thrown by libnl and replaces them with this not very descriptive message and stack-trace instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions