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

@ -166,30 +166,18 @@ func (q *Queue) TrackError() {
func (q *Queue) getPacketMeta(pkt gopacket.Packet) 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 {
meta[k] = v
}
}
if nbns != nil {
if nbns := NBNSGetMeta(pkt); nbns != nil {
for k, v := range nbns {
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
}