diff --git a/pndp/process.go b/pndp/process.go index d97a395..83fea56 100644 --- a/pndp/process.go +++ b/pndp/process.go @@ -56,7 +56,7 @@ func (obj *ResponderObj) start() { }() go respond(obj.iface, requests, ndp_ADV, obj.filter, obj.autosense, obj.stopWG, obj.stopChan) go listen(obj.iface, requests, ndp_SOL, obj.stopWG, obj.stopChan) - fmt.Println("Started responder instance") + fmt.Println("Started responder instance on interface ", obj.iface) <-obj.stopChan } @@ -122,6 +122,7 @@ func (obj *ProxyObj) start() { go listen(obj.iface2, req_iface2_adv_iface1, ndp_ADV, obj.stopWG, obj.stopChan) go respond(obj.iface1, req_iface2_adv_iface1, ndp_ADV, nil, "", obj.stopWG, obj.stopChan) + fmt.Println("Started Proxy instance for interfaces: ", obj.iface1, " and ", obj.iface2) <-obj.stopChan } diff --git a/pndp/rawsocket.go b/pndp/rawsocket.go index 47dca89..cbac53a 100644 --- a/pndp/rawsocket.go +++ b/pndp/rawsocket.go @@ -62,7 +62,9 @@ func listen(iface string, responder chan *ndpRequest, requestType ndpType, stopW syscall.Close(fd) stopWG.Done() // syscall.read does not release when the file descriptor is closed }() - fmt.Println("Obtained fd ", fd) + if GlobalDebug { + fmt.Println("Obtained fd ", fd) + } if len([]byte(iface)) > syscall.IFNAMSIZ { panic("Interface size larger then maximum allowed by the kernel") @@ -113,6 +115,7 @@ func listen(iface string, responder chan *ndpRequest, requestType ndpType, stopW panic(err) } if GlobalDebug { + fmt.Println("Got packet on", iface, "of type", requestType) fmt.Println("Source IP:") fmt.Printf("% X\n", buf[:numRead][22:38]) fmt.Println("Destination IP:") diff --git a/pndp/responder.go b/pndp/responder.go index ce45e50..62cf9c0 100644 --- a/pndp/responder.go +++ b/pndp/responder.go @@ -87,6 +87,10 @@ func respond(iface string, requests chan *ndpRequest, respondType ndpType, filte } } + if GlobalDebug { + fmt.Println("Getting ready to send packet of type", respondType, "out on interface", iface) + } + if n.sourceIface == iface { pkt(fd, result, n.srcIP, n.answeringForIP, niface.HardwareAddr, respondType) } else {