mirror of
https://github.com/slackhq/nebula.git
synced 2025-12-17 04:18:27 +01:00
Merge remote-tracking branch 'origin/master' into multiport
This commit is contained in:
@@ -64,6 +64,22 @@ func (ua *Addr) Copy() *Addr {
|
||||
return &nu
|
||||
}
|
||||
|
||||
type AddrSlice []*Addr
|
||||
|
||||
func (a AddrSlice) Equal(b AddrSlice) bool {
|
||||
if len(a) != len(b) {
|
||||
return false
|
||||
}
|
||||
|
||||
for i := range a {
|
||||
if !a[i].Equals(b[i]) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
func ParseIPAndPort(s string) (net.IP, uint16, error) {
|
||||
rIp, sPort, err := net.SplitHostPort(s)
|
||||
if err != nil {
|
||||
|
||||
@@ -62,7 +62,7 @@ func (u *Conn) Send(packet *Packet) {
|
||||
if err := h.Parse(packet.Data); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
if u.l.Level >= logrus.InfoLevel {
|
||||
if u.l.Level >= logrus.DebugLevel {
|
||||
u.l.WithField("header", h).
|
||||
WithField("udpAddr", fmt.Sprintf("%v:%v", packet.FromIp, packet.FromPort)).
|
||||
WithField("dataLen", len(packet.Data)).
|
||||
|
||||
Reference in New Issue
Block a user