some NetBufferUtility revamp.
- introduced base NetBufferFieldReader which deals with obtaining a continuguous field to deal with. - renamed Detach() to Sync() to better express the fact that we may be writing to the buffer. - Fixed IPv4's and ICMP's checksum calculation as it assumed the underlying header was contiguous. - ICMP is now able to reply to ICMP Echo Requests which were split across data nodes. - in split_buffer(), make sure we were able to trim() the new buffer before damaging the original one. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20657 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -464,9 +464,10 @@ split_buffer(net_buffer *from, uint32 offset)
|
||||
|
||||
TRACE(("split_buffer(buffer %p -> %p, offset %ld)\n", from, buffer, offset));
|
||||
|
||||
if (remove_header(from, offset) == B_OK
|
||||
&& trim_data(buffer, offset) == B_OK)
|
||||
return buffer;
|
||||
if (trim_data(buffer, offset) == B_OK) {
|
||||
if (remove_header(from, offset) == B_OK)
|
||||
return buffer;
|
||||
}
|
||||
|
||||
free_buffer(buffer);
|
||||
return NULL;
|
||||
|
||||
Reference in New Issue
Block a user