batch_ping icon indicating copy to clipboard operation
batch_ping copied to clipboard

pid mismatch int != uint16

Open sebstyle opened this issue 3 years ago • 0 comments

pid is stored as int but gets converted to uint16 and thus will never match when processPacket compares int on batchpinger to uint16 from packet

// Pinger.SendICMP

xid := p.id & 0xffff
body := &icmp.Echo{
    ID:   xid,
    Seq:  seqID,
    Data: t,
}

// BatchPinger.processPacket

xid :=  p.id & 0xffff
if pkt.ID != xid {
...
}

sebstyle avatar Mar 31 '21 21:03 sebstyle