update gobgp pkg

This commit is contained in:
Ian Azpiazu
2022-05-16 13:40:57 -04:00
parent 878ee3a63e
commit 80d743ffa5
652 changed files with 136451 additions and 98241 deletions

View File

@@ -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(), "[") {