-
Notifications
You must be signed in to change notification settings - Fork 10
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
Destination address is not right #13
Comments
Do you have a reproduction test case? I'm unable to reproduce this on my systems. example.gopackage main
import (
"fmt"
"log"
"github.com/cloudflare/ipvs"
)
func main() {
c, err := ipvs.New()
if err != nil {
log.Fatalf("error updating service: %v", err)
}
services, err := c.Services()
if err != nil {
log.Fatalf("error fetching services: %v", err)
}
for _, svc := range services {
fmt.Printf("| %s:%d/%s %s\n", svc.Address, svc.Port, svc.Protocol, svc.Scheduler)
destinations, err := c.Destinations(svc.Service)
if err != nil {
log.Fatalf("error fetching destinations: %v", err)
}
for _, dest := range destinations {
fmt.Printf("|- %s:%d (%s) %d\n", dest.Address, dest.Port, dest.FwdMethod, dest.Weight)
}
}
} ipvsadm -Ln
ipvsadm -Sn
example
|
This is the unit test I do:
|
|
I don't know what it happened, so I do this:
|
Thanks. That's an old kernel, and I wonder if the representation format changed. I'll try to track down CentOS 7.5 and see. |
I can reproduce on "CentOS Linux release 7.9.2009" and kernel "3.10.0-1160.102.1.el7.x86_64". This extremely legacy kernel predates torvalds/linux@6cff339, which allows IPv4 traffic to be tunneled to an IPv6 destination by adding a per-destination address family. This patch was also not backported to the kernel CentOS uses.
Note that this results in broken behavior if you attempt to configure an IPv6 tunnel destination for a IPv4 service, which neither the shipped version of
This kernel is outside of the kernel releases we'd test against, predating even the oldest LTS release. The fix here is small, so I'll go ahead and include it, but you may run into other issues with other functionality. |
In some legacy kernels IPVS did not support destinations with differing address families from their services. This was changed to allow tunneling IPv4 traffic over an IPv6 network, and in the process destinations gained an address family field. If this package was used on kernels predating this change, no address family would have been found, and IP address parsing was done in IPv6 mode. This changeset now defaults to the service's address family if not set by the destination. Bug: #13 Reference: https://www.spinics.net/lists/lvs-devel/msg03723.html
Thanks so much. |
My destination address is ipv4,but when I use destination.Address(),it got a ipv6 address.Why?What happened?
The text was updated successfully, but these errors were encountered: