What steps will reproduce the problem?
1. ep = NewTCPPortEndpoint(layers.TCPPort(1010))
2. fmt.Println(hex.Dump(ep.Raw))
What is the expected output? What do you see instead?
expect 0x0a 0x0a 0x00....
see 0x00 0x0a 0x00...
What version of the product are you using? On what operating system?
git put from head on 9/23/14. On Ubuntu 12.04 / linux 3.8
Please provide any additional information below.
suggest this patch :
diff --git a/layers/endpoints.go b/layers/endpoints.go
index 03793a8..193eef1 100644
--- a/layers/endpoints.go
+++ b/layers/endpoints.go
@@ -64,7 +64,7 @@ func NewMACEndpoint(a net.HardwareAddr) gopacket.Endpoint {
return gopacket.NewEndpoint(EndpointMAC, []byte(a))
}
func newPortEndpoint(t gopacket.EndpointType, p uint16) gopacket.Endpoint {
- return gopacket.NewEndpoint(t, []byte{byte(p >> 16), byte(p)})
+ return gopacket.NewEndpoint(t, []byte{byte(p >> 8), byte(p)})
}
// NewTCPPortEndpoint returns an endpoint based on a TCP port.
Original issue reported on code.google.com by ricky.ch...@gmail.com on 23 Sep 2014 at 11:53
Original issue reported on code.google.com by
ricky.ch...@gmail.com
on 23 Sep 2014 at 11:53