Commit 3d6bf6e
committed
Fix MTU detection to work with netlink v1.3.1
The vendor dependency update in the previous commit pulled in netlink
v1.3.1 which changed how default routes are represented. In v1.1.0,
default routes had route.Dst == nil, but in v1.3.1+, they have
route.Dst set to 0.0.0.0/0 (IPv4) or ::/0 (IPv6).
The existing code checked "if route.Dst != nil { continue }" to skip
non-default routes, which incorrectly skipped default routes with the
new netlink version, causing "unable to determine MTU" errors.
This fix updates the default route detection logic to handle both:
- Old behavior (v1.1.0): route.Dst == nil
- New behavior (v1.3.1+): route.Dst == 0.0.0.0/0 or ::/0
The fix checks if Dst is nil OR if it represents a default route by
verifying the IP is all zeros and the prefix length is 0.
Signed-off-by: zhaozhanqi <zzhao@redhat.com>1 parent f7dbde0 commit 3d6bf6e
1 file changed
+14
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
| |||
30 | 32 | | |
31 | 33 | | |
32 | 34 | | |
33 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
34 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
35 | 48 | | |
36 | 49 | | |
37 | 50 | | |
| |||
0 commit comments