]> git.ipfire.org Git - thirdparty/dhcpcd.git/commit
BSD: Loop when pulling routes into our buffer if no memory
authorRoy Marples <roy@marples.name>
Thu, 20 Feb 2025 13:41:34 +0000 (13:41 +0000)
committerRoy Marples <roy@marples.name>
Thu, 20 Feb 2025 13:41:34 +0000 (13:41 +0000)
commitf7a6397be0051dce246f1caee908e873e0853633
tree5badbd9c42884569f600a1a47f4ec0724c864b0e
parentb7105e1982a39332bd8bdf81b21431cad83fb7f0
BSD: Loop when pulling routes into our buffer if no memory

We need to make two sysctls to pull the route table from the kernel.
The first one works out the size of the buffer required and the
second one populates it.
It's possible for more routes to be added between these two calls
causing the second call to fail with ENOMEM.
If this happens, just re-query the size needed and try again.

Fixes #466.
src/if-bsd.c