Skip to content

Commit

Permalink
Fix that Antrea Agent may crash when dualstack
Browse files Browse the repository at this point in the history
When a Cluster is dualstack, it assumes that every Node is configured with
both IPv4 and IPv6 addresses for Antrea Agent. However, if a Node is only
configured with either IPv4 or IPv6 address, Antrea Agent will get crashed.

Signed-off-by: Hongliang Liu <lhongliang@vmware.com>
  • Loading branch information
hongliangl committed Dec 14, 2022
1 parent 630f68f commit d1f5f13
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkg/agent/openflow/pod_connectivity.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,19 @@ func newFeaturePodConnectivity(
if ipProtocol == binding.ProtocolIP {
ctZones[ipProtocol] = CtZone
gatewayIPs[ipProtocol] = nodeConfig.GatewayConfig.IPv4
nodeIPs[ipProtocol] = nodeConfig.NodeIPv4Addr.IP
if nodeConfig.NodeIPv4Addr != nil {
nodeIPs[ipProtocol] = nodeConfig.NodeIPv4Addr.IP
}
if nodeConfig.PodIPv4CIDR != nil {
localCIDRs[ipProtocol] = *nodeConfig.PodIPv4CIDR
}
ipCtZoneTypeRegMarks[ipProtocol] = IPCtZoneTypeRegMark
} else if ipProtocol == binding.ProtocolIPv6 {
ctZones[ipProtocol] = CtZoneV6
gatewayIPs[ipProtocol] = nodeConfig.GatewayConfig.IPv6
nodeIPs[ipProtocol] = nodeConfig.NodeIPv6Addr.IP
if nodeConfig.NodeIPv6Addr != nil {
nodeIPs[ipProtocol] = nodeConfig.NodeIPv6Addr.IP
}
if nodeConfig.PodIPv6CIDR != nil {
localCIDRs[ipProtocol] = *nodeConfig.PodIPv6CIDR
}
Expand Down

0 comments on commit d1f5f13

Please sign in to comment.