# HG changeset patch # Parent 1a92827cdbd611aa6be133067b087f69b9f052b5 diff -r 1a92827cdbd6 src/internet-stack/ipv4-raw-socket-impl.cc --- a/src/internet-stack/ipv4-raw-socket-impl.cc Sun Apr 04 23:09:58 2010 +0900 +++ b/src/internet-stack/ipv4-raw-socket-impl.cc Sun Apr 04 23:11:35 2010 +0900 @@ -1,3 +1,4 @@ +#include #include "ipv4-raw-socket-impl.h" #include "ipv4-l3-protocol.h" #include "icmpv4.h" @@ -230,7 +231,10 @@ if (data.packet->GetSize () > maxSize) { Ptr first = data.packet->CreateFragment (0, maxSize); - data.packet->RemoveAtStart (maxSize); + if (!(flags & MSG_PEEK)) + { + data.packet->RemoveAtStart (maxSize); + } m_recv.push_front (data); return first; } diff -r 1a92827cdbd6 src/internet-stack/ipv6-raw-socket-impl.cc --- a/src/internet-stack/ipv6-raw-socket-impl.cc Sun Apr 04 23:09:58 2010 +0900 +++ b/src/internet-stack/ipv6-raw-socket-impl.cc Sun Apr 04 23:11:35 2010 +0900 @@ -18,6 +18,7 @@ * Author: Sebastien Vincent */ +#include #include "ns3/inet6-socket-address.h" #include "ns3/node.h" #include "ns3/packet.h" @@ -265,7 +266,10 @@ if (data.packet->GetSize () > maxSize) { Ptr first = data.packet->CreateFragment (0, maxSize); - data.packet->RemoveAtStart (maxSize); + if (!(flags & MSG_PEEK)) + { + data.packet->RemoveAtStart (maxSize); + } m_data.push_front (data); return first; }