Swift IPv4 add support for outbound fragments - #56
Conversation
|
|
||
| mutating func writeOutboundFrames(_ frames: inout FrameArray) { | ||
| frames.iterateMutableFrames { frame in | ||
| var output = FrameArray() |
There was a problem hiding this comment.
Can we avoid unconditionally creating a new array here? If we don't need fragmentation, I'd rather modify in place
There was a problem hiding this comment.
One way we could do this is create a fragments array at the start of the function. Then keep frames.iterateMutableFrames for the standard path. If a frame in that array is detected to have a payload over the MTU and we need to split it those fragments are added to the fragment array. The thing to consider is that those newly generated fragments are then added to the end of the outbound frames array. This is a slight deviation in ordering that we may need to consider here.
There was a problem hiding this comment.
Added a change to preserve the ordering 37e1d07
Add support for Swift IPv4 for outbound fragmentation.