Commit f7a6397
committed
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.1 parent b7105e1 commit f7a6397
1 file changed
+16
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
965 | 965 | | |
966 | 966 | | |
967 | 967 | | |
968 | | - | |
| 968 | + | |
969 | 969 | | |
970 | 970 | | |
| 971 | + | |
971 | 972 | | |
972 | | - | |
973 | | - | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
974 | 976 | | |
975 | | - | |
976 | | - | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
977 | 981 | | |
978 | 982 | | |
979 | | - | |
980 | | - | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
981 | 986 | | |
982 | 987 | | |
983 | 988 | | |
| |||
1001 | 1006 | | |
1002 | 1007 | | |
1003 | 1008 | | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
1004 | 1013 | | |
1005 | 1014 | | |
1006 | 1015 | | |
| |||
0 commit comments