Some more useful logs, to troubleshoot.

master
Uriel Fanelli 2023-08-12 23:49:38 +02:00
parent b0f1d7a644
commit 8f3452988e
2 changed files with 3 additions and 4 deletions

3
arp.go
View File

@ -135,9 +135,6 @@ func sendARP(iface *net.Interface, m *arpMessage) error {
if m.opcode == opARPReply { if m.opcode == opARPReply {
target = m.targetHardwareAddress target = m.targetHardwareAddress
} }
// for i := 0; i < len(target); i++ {
// ll.Addr[i] = target[i]
// }
log.Println("Copied ARP: ", copy(ll.Addr[:], target)) log.Println("Copied ARP: ", copy(ll.Addr[:], target))

View File

@ -17,13 +17,15 @@ func (mip *AbstractMulticast) AddUniqueAndSort(hier int64) {
} else { } else {
mip.HierarchyArray = append(mip.HierarchyArray, hier) mip.HierarchyArray = append(mip.HierarchyArray, hier)
sort.Slice(mip.HierarchyArray, func(i, j int) bool { return mip.HierarchyArray[i] < mip.HierarchyArray[j] }) sort.Slice(mip.HierarchyArray, func(i, j int) bool { return mip.HierarchyArray[i] < mip.HierarchyArray[j] })
log.Println(mip.HierarchyArray) log.Println("Here the numbers known:", mip.HierarchyArray)
} }
} }
func (mip *AbstractMulticast) IsAlpha(hier int64) bool { func (mip *AbstractMulticast) IsAlpha(hier int64) bool {
log.Println("Element 0 is :", mip.HierarchyArray[0])
return mip.HierarchyArray[0] == hier return mip.HierarchyArray[0] == hier
} }