Bugzilla – Bug 2254
Ipv[4,6]RawSocket can return the wrong number of bytes sent.
Last modified: 2016-01-17 17:16:45 UTC
Reported by Stefano Avallone <stavallo@gmail.com>. The Send return value depends on how the NetDevice is adding its headers to the packet. The number of sent bytes should be independent on the NetDevice operations.
changeset: 11810:a7f3de5f353c
Tommaso, this fix doesn't consider about the optional attribute of "IpHeaderInclude". http://code.nsnam.org/ns-3-dev/file/a7f3de5f353c/src/internet/model/ipv4-raw-socket-impl.cc#l38 37 // 38 // from raw (7), linux, returned length of Send/Recv should be 39 // 40 // | IP_HDRINC on | off | 41 // ----------+---------------+-------------+- 42 // Send(Ipv4)| hdr + payload | payload | 43 // Recv(Ipv4)| hdr + payload | hdr+payload | 44 // ----------+---------------+-------------+- 45 .AddAttribute ("IpHeaderInclude", 46 "Include IP Header information (a.k.a setsockopt (IP_HDRINCL)).", 47 BooleanValue (false), 48 MakeBooleanAccessor (&Ipv4RawSocketImpl::m_iphdrincl), 49 MakeBooleanChecker ()) if this is option is true, the Send() should return "p->GetSize()" as the previous version. is it possible to address this issue while fixing the original issue you faced ?
changeset 11820 4700f632bc8f
(In reply to Tommaso Pecorella from comment #3) > changeset 11820 4700f632bc8f Thanks. The fix is fine with DCE tests.