update gobgp pkg
This commit is contained in:
12
vendor/github.com/osrg/gobgp/pkg/server/util.go
generated
vendored
12
vendor/github.com/osrg/gobgp/pkg/server/util.go
generated
vendored
@@ -59,20 +59,12 @@ func decodeAdministrativeCommunication(data []byte) (string, []byte) {
|
||||
if communicationLen > bgp.BGP_ERROR_ADMINISTRATIVE_COMMUNICATION_MAX {
|
||||
communicationLen = bgp.BGP_ERROR_ADMINISTRATIVE_COMMUNICATION_MAX
|
||||
}
|
||||
if communicationLen > len(data)+1 {
|
||||
communicationLen = len(data) + 1
|
||||
if communicationLen > len(data)-1 {
|
||||
communicationLen = len(data) - 1
|
||||
}
|
||||
return string(data[1 : communicationLen+1]), data[communicationLen+1:]
|
||||
}
|
||||
|
||||
func extractFamilyFromTCPListener(l *net.TCPListener) int {
|
||||
family := syscall.AF_INET
|
||||
if strings.Contains(l.Addr().String(), "[") {
|
||||
family = syscall.AF_INET6
|
||||
}
|
||||
return family
|
||||
}
|
||||
|
||||
func extractFamilyFromTCPConn(conn *net.TCPConn) int {
|
||||
family := syscall.AF_INET
|
||||
if strings.Contains(conn.RemoteAddr().String(), "[") {
|
||||
|
||||
Reference in New Issue
Block a user