tiiuae / mesh_com

ROS node for Mesh Network configuration
BSD 3-Clause "New" or "Revised" License
16 stars 17 forks source link

MDM Agent: Use auto-calculated buffer size in IPRoute.get() call #470

Closed pentestiing closed 3 months ago

pentestiing commented 3 months ago

The title :up:

Apparently in some cases the call to IPRoute.get() might result in No buffer space available:

File "/opt/nats/src/comms_if_monitor.py", line 67, in monitor_interfaces messages = self.__ipr.get() File "/usr/lib/python3.9/site-packages/pyroute2/netlink/nlsocket.py", line 376, in get File "/usr/lib/python3.9/site-packages/pyroute2/netlink/nlsocket.py", line 776, in get File "/usr/lib/python3.9/site-packages/pyroute2/netlink/nlsocket.py", line 554, in recv_ft OSError: [Errno 105] No buffer space available

To workaround this issue we are making the bufsize autodetectable.

It shall be noted that this feature seems to be broken in pyroute2 version 0.7.12, but the versions included in iMX8 and RPIOS are lower, so a TODO has been added in the line for future changes.

Documentation: https://docs.pyroute2.org/nlsocket.html#pyroute2.netlink.nlsocket.NetlinkSocketBaseSafe.get

Jira-ID: SECO-6713

:crystal_ball: