Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Where does raven0 link gets its parentIndex? #138

Open
suyuee opened this issue Oct 24, 2023 · 5 comments
Open

Where does raven0 link gets its parentIndex? #138

suyuee opened this issue Oct 24, 2023 · 5 comments

Comments

@suyuee
Copy link

suyuee commented Oct 24, 2023

I noticed in our setup the wireguard fails to set up properly sometimes. due to

 error syncing event gw-lambdalabs: fail to ensure wireguar link: error getting default link to: 10.0.95.21, error get vxlan parent with index 0: invalid argument 

So the problems is the parent index is 0;

code pointer:

if vxLink, ok := link.(*netlink.Vxlan); ok {
link, err = netlinkutil.LinkByIndex(vxLink.ParentIndex)
if err != nil {
return nil, fmt.Errorf("error get vxlan parent: %v", err)
}
}

But it seems when creating the vxlan link, the code doesn't actually specify a parentIndex here:

LinkAttrs: netlink.LinkAttrs{
Name: vxlanLinkName,
MTU: func(a, b int) int {
if a > b {
return b
}
return a
}(vpnDriverMTU, routeDriverMTU),
Flags: net.FlagUp,
},
VxlanId: vxlanID,

When searching the netlink repo, I don't see the parentIndex field set for vxlan links (not sure if it's https://github.com/vishvananda/netlink/blob/77df5d35f725f10c8ca5f5552c95782fd639b46c/link_linux.go#L2098)

Any thoughts? Thanks in advance

@suyuee
Copy link
Author

suyuee commented Oct 24, 2023

Also seems when there isn't such an error ("error get vxlan parent"...), seems the code path is not triggered and ParentIndex is 0 as well.

@njucjc
Copy link
Member

njucjc commented Oct 25, 2023

Also seems when there isn't such an error ("error get vxlan parent"...), seems the code path is not triggered and ParentIndex is 0 as well.

Why your default route is point to a vxlan interface?usually it will point to eth0

@suyuee
Copy link
Author

suyuee commented Oct 25, 2023

ah... I think it's due to our customization, on our edge side, nodes can't talk to each other with their private ip directly; we have to rely on vxlan; that should be why

I think I should just customize it further and do not check parent index of the vxlan? seems it's just never set. Not sure if doing this for raven also makes sense through; the other approach is to set parent index during vxlan creation

@njucjc
Copy link
Member

njucjc commented Oct 26, 2023

ah... I think it's due to our customization, on our edge side, nodes can't talk to each other with their private ip directly; we have to rely on vxlan; that should be why

I think I should just customize it further and do not check parent index of the vxlan? seems it's just never set. Not sure if doing this for raven also makes sense through; the other approach is to set parent index during vxlan creation

@suyuee I'm not sure if vxlan(raven0) over vxlan (your own vxlan interface) can be supported in raven or not, but the following check can be remove exactly.

 if vxLink, ok := link.(*netlink.Vxlan); ok { 
 	link, err = netlinkutil.LinkByIndex(vxLink.ParentIndex) 
 	if err != nil { 
 		return nil, fmt.Errorf("error get vxlan parent: %v", err) 
 	} 
 } 

can you open a pr to fix it ?

@suyuee
Copy link
Author

suyuee commented Oct 26, 2023

Thanks for the insights, will open a pr for it. (kinda busy recently, but will do once I get a chance)

Btw, we don't use vxlan over vxlan, but just using raven vxlan fwiw

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants