Commit 72a8cd7
fix: set ifindex in RTM_GETADDR to avoid dumping all addresses
When a link is provided, AddrList was doing a full NLM_F_DUMP of all
addresses and filtering in the client side. On systems with many interfaces
this is wasteful and prone to NLM_F_DUMP_INTR errors.
Set ifa_index in the request message so the kernel can do the filtering.
Kernel-side filtering requires NETLINK_GET_STRICT_CHK to be enabled
on the handle (Handle.SetStrictCheck). Without it, the kernel ignores
the index field and the existing userspace filter serves as fallback.
Signed-off-by: Patryk Diak <pdiak@redhat.com>1 parent ddba687 commit 72a8cd7
1 file changed
+8
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | 206 | | |
213 | 207 | | |
214 | 208 | | |
215 | 209 | | |
216 | 210 | | |
217 | 211 | | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
218 | 220 | | |
219 | 221 | | |
220 | 222 | | |
| |||
0 commit comments