cosmetics

suggested by linter
This commit is contained in:
Matthias Radestock committed 2015-02-03 14:46:35 +00:00
1 parent b42766fb81
commit 9c3d509b10
4 files changed
+11 -12

No files matched your search

+2 -3
View File
@@ -65,10 +65,9 @@ func rdnsHandler(lookups []Lookup) dns.HandlerFunc {
}
fallback(w, r)
return
} else {
Warning.Printf("[dns msgid %d] Unexpected reverse query type %s: %+v",
r.MsgHdr.Id, dns.TypeToString[q.Qtype], q)
}
Warning.Printf("[dns msgid %d] Unexpected reverse query type %s: %+v",
r.MsgHdr.Id, dns.TypeToString[q.Qtype], q)
}
}
+7 -7
View File
@@ -117,15 +117,15 @@ func (cm *ConnectionMaker) checkStateAndAttemptConnections() time.Duration {
validTarget := make(map[string]bool)
// copy the set of things we are connected to, so we can access them without locking
our_connected_peers := make(map[PeerName]bool)
our_connected_targets := make(map[string]bool)
ourConnectedPeers := make(map[PeerName]bool)
ourConnectedTargets := make(map[string]bool)
cm.ourself.ForEachConnection(func(peer PeerName, conn Connection) {
our_connected_peers[peer] = true
our_connected_targets[conn.RemoteTCPAddr()] = true
ourConnectedPeers[peer] = true
ourConnectedTargets[conn.RemoteTCPAddr()] = true
})
addTarget := func(address string) {
if !our_connected_targets[address] {
if !ourConnectedTargets[address] {
validTarget[address] = true
cm.addTarget(address)
}
@@ -140,7 +140,7 @@ func (cm *ConnectionMaker) checkStateAndAttemptConnections() time.Duration {
// aren't
cm.peers.ForEach(func(name PeerName, peer *Peer) {
peer.ForEachConnection(func(otherPeer PeerName, conn Connection) {
if otherPeer == cm.ourself.Name || our_connected_peers[otherPeer] {
if otherPeer == cm.ourself.Name || ourConnectedPeers[otherPeer] {
return
}
address := conn.RemoteTCPAddr()
@@ -155,7 +155,7 @@ func (cm *ConnectionMaker) checkStateAndAttemptConnections() time.Duration {
now := time.Now() // make sure we catch items just added
after := MaxDuration
for address, target := range cm.targets {
if our_connected_targets[address] {
if ourConnectedTargets[address] {
delete(cm.targets, address)
continue
}
+1 -1
View File
@@ -192,7 +192,7 @@ func fragment(eth layers.Ethernet, ip layers.IPv4, pmtu int, frame *ForwardedFra
return err
}
// make copies of the frame we received
var segFrame ForwardedFrame = *frame
segFrame := *frame
segFrame.frame = buf.Bytes()
forward(&segFrame)
}
+1 -1
View File
@@ -51,7 +51,7 @@ func main() {
}
}
var iface *net.Interface = nil
var iface *net.Interface
if ifaceName != "" {
var err error
Info.Println("Waiting for interface", ifaceName, "to come up")