proxy protocol: fix detect method for IPV4 and IPV6

pull/1411/head
fatedier 6 years ago
parent d8d587fd93
commit fdc6902a90

@ -521,7 +521,7 @@ func HandleTcpWorkConnection(localInfo *config.LocalSvrConf, proxyPlugin plugin.
DestinationPort: m.DstPort, DestinationPort: m.DstPort,
} }
if h.SourceAddress.To16() == nil { if strings.Contains(m.SrcAddr, ".") {
h.TransportProtocol = pp.TCPv4 h.TransportProtocol = pp.TCPv4
} else { } else {
h.TransportProtocol = pp.TCPv6 h.TransportProtocol = pp.TCPv6

Loading…
Cancel
Save