misc: small fix or general refactoring i did not bother commenting

This commit is contained in:
evilsocket 2018-09-09 12:39:44 +03:00
parent e2cc4574c4
commit eba546bef6
No known key found for this signature in database
GPG key ID: 1564D7F30393A456
2 changed files with 2 additions and 17 deletions

View file

@ -110,9 +110,6 @@ func (p *Prober) Start() error {
} else if p.Session.Skip(ip) { } else if p.Session.Skip(ip) {
log.Debug("Skipping address %s from UDP probing.", ip) log.Debug("Skipping address %s from UDP probing.", ip)
continue continue
} else if p.Session.Lan.GetByIp(ip.String()) != nil {
log.Debug("Skipping address %s from UDP probing (already in the arp cache).", ip)
continue
} }
p.sendProbe(from, from_hw, ip) p.sendProbe(from, from_hw, ip)

View file

@ -166,30 +166,18 @@ func (q *Queue) TrackError() {
func (q *Queue) getPacketMeta(pkt gopacket.Packet) map[string]string { func (q *Queue) getPacketMeta(pkt gopacket.Packet) map[string]string {
meta := make(map[string]string) meta := make(map[string]string)
mdns := MDNSGetMeta(pkt)
nbns := NBNSGetMeta(pkt)
if mdns != nil { if mdns := MDNSGetMeta(pkt); mdns != nil {
for k, v := range mdns { for k, v := range mdns {
meta[k] = v meta[k] = v
} }
} }
if nbns != nil { if nbns := NBNSGetMeta(pkt); nbns != nil {
for k, v := range nbns { for k, v := range nbns {
meta[k] = v meta[k] = v
} }
} }
/*
// check if the packet is a useful mDNS query response
hostname := MDNSGetHostname(pkt)
// check if we can get some meta info from mDNS TXT records
meta := MDNSGetMeta(pkt)
if hostname != "" {
meta["mdns:hostname"] = hostname
}
*/
return meta return meta
} }