mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #2416 from herrwagner/2289-fix-ipv6-hardcode
Fix hardcoded AF_INET for IPv6 address handling
This commit is contained in:
commit
4779705fb0
1 changed files with 4 additions and 3 deletions
|
@ -422,8 +422,11 @@ func assembleDestination(attrs []syscall.NetlinkRouteAttr) (*Destination, error)
|
||||||
attrType := int(attr.Attr.Type)
|
attrType := int(attr.Attr.Type)
|
||||||
|
|
||||||
switch attrType {
|
switch attrType {
|
||||||
|
|
||||||
|
case ipvsDestAttrAddressFamily:
|
||||||
|
d.AddressFamily = native.Uint16(attr.Value)
|
||||||
case ipvsDestAttrAddress:
|
case ipvsDestAttrAddress:
|
||||||
ip, err := parseIP(attr.Value, syscall.AF_INET)
|
ip, err := parseIP(attr.Value, d.AddressFamily)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -438,8 +441,6 @@ func assembleDestination(attrs []syscall.NetlinkRouteAttr) (*Destination, error)
|
||||||
d.UpperThreshold = native.Uint32(attr.Value)
|
d.UpperThreshold = native.Uint32(attr.Value)
|
||||||
case ipvsDestAttrLowerThreshold:
|
case ipvsDestAttrLowerThreshold:
|
||||||
d.LowerThreshold = native.Uint32(attr.Value)
|
d.LowerThreshold = native.Uint32(attr.Value)
|
||||||
case ipvsDestAttrAddressFamily:
|
|
||||||
d.AddressFamily = native.Uint16(attr.Value)
|
|
||||||
case ipvsDestAttrActiveConnections:
|
case ipvsDestAttrActiveConnections:
|
||||||
d.ActiveConnections = int(native.Uint16(attr.Value))
|
d.ActiveConnections = int(native.Uint16(attr.Value))
|
||||||
case ipvsDestAttrInactiveConnections:
|
case ipvsDestAttrInactiveConnections:
|
||||||
|
|
Loading…
Add table
Reference in a new issue