Varying data from IPConn.ReadFromIP(With and without IP header)

83 views
Skip to first unread message

hari

unread,
Jan 3, 2014, 11:25:16 AM1/3/14
to golan...@googlegroups.com

Hello All,

I am new to Go, so please bear with me. I was trying to implement an ICMP type 8(echo) request in Go for practice. The ICMP packet has a size of 12 bytes(4 bytes as my data). I retrieve the When I allocate an buffer of say 100 bytes and pass it to ReadFromIp function,  I find that I only receive the ICMP echo response packet, with no IP header. But when I allocate exactly 32 bytes for my buffer, I find that the data is an IP header followed by the ICMP response packet. 

Is that a bug? I am also unsure about how to decide an appropriatly sized buffer to pass to the ReadFromIp function if the size changes like this.

Please advice,

Srihari.

Francesc Campoy Flores

unread,
Jan 3, 2014, 6:07:23 PM1/3/14
to hari, golan...@googlegroups.com
Hi Hari,

Please provide some real code with what you're actually doing so we can understand your problem and help you.

Thanks,


--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
--
Francesc Campoy

Dave Cheney

unread,
Jan 3, 2014, 6:20:35 PM1/3/14
to Francesc Campoy Flores, hari, golan...@googlegroups.com
Please also refer to the bugs section at the bottom of this page, http://godoc.org/net, also viewable with

   godoc net


hari

unread,
Jan 4, 2014, 9:24:00 AM1/4/14
to golan...@googlegroups.com, Francesc Campoy Flores, hari
Ahh thank you for that, so its a known bug! I solved the issue with a simple Read call instead, thanks a lot guys

speter

unread,
Jan 4, 2014, 9:40:34 AM1/4/14
to golang-nuts
Would it be considered reasonable to change the location of the Bugs section in godoc to somewhere more prominent? I'd suggest right after the index, or maybe even right before it.

At its current position (at the very end), I have the feeling that it is almost certain that no-one will ever look at it unless pointed to by someone else.

Peter

Reply all
Reply to author
Forward
0 new messages