|
Bugzilla – Full Text Bug Listing |
| Summary: | Error uses of htonl making OpenFlow‘s match field error. | ||
|---|---|---|---|
| Product: | ns-3 | Reporter: | Long Li <lilong> |
| Component: | openflow | Assignee: | Blake Hurd <naimorai> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | ns-bugs, tomh, tommaso.pecorella |
| Priority: | P3 | ||
| Version: | ns-3.15 | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Bug Depends on: | 1456 | ||
| Bug Blocks: | |||
| Attachments: |
path file,see this file for detail
Patch fixing htons for TCP and UDP ports |
||
+1, however...
A few lines above there is the very same error about TCP:
tcp_h->tcp_src = htonl (tcp_hd.GetSourcePort ()); // Source Port
tcp_h->tcp_dst = htonl (tcp_hd.GetDestinationPort ()); // Destination Port
I can't be sure if the same issue isn't elsewhere as well.
T.
yeah, the same process should be done for the tcp lines
tcp_h->tcp_src = htonl (tcp_hd.GetSourcePort ()); // Source Port
tcp_h->tcp_dst = htonl (tcp_hd.GetDestinationPort ()); // Destination
Apologize for forgetting it.
Created attachment 1493 [details]
Patch fixing htons for TCP and UDP ports
This patch fixes both TCP and UDP ports wrong htonl calls.
+1 I believe that once the openflow repo is updated, this patch can be applied to it. See bug 1456. Fixed in changeset 9249 - 93d61b00eb6f |
Created attachment 1488 [details] path file,see this file for detail In function OpenFlowSwitchNetDevice::BufferFromPacket() of file openflow-switch-netdevice.cc, udp_h->udp_src = htonl (udp_hd.GetSourcePort ()) uses htonl to convert source port from network order to host order, the field udp_src is defined as uint16_t, however. Using htonl will always make the value of udp_h->udp_src to be zero in little-endian machine. The correct function should be htons().