Acked-by: Frank Lichtenheld <fr...@lichtenheld.com> > Arne Schwabe <a...@rfc2549.org> hat am 07.12.2021 18:01 geschrieben: > @@ -246,6 +262,8 @@ static inline int > frame_headroom(const struct frame *f) > { > const int offset = FRAME_HEADROOM_BASE(f); > + /* These two lines just pad offset to next multiple of PAYLOAD_ALIGN in > + * a complicated and confusing way */ > const int delta = ((PAYLOAD_ALIGN << 24) - offset) & (PAYLOAD_ALIGN - 1);
The 24 is completely arbitrary, right? As long as the result is always bigger than offset, you can use any other number. I wonder whether it might be possible to replace it with something slightly less confusing (IMHO, anyway), like delta = (PAYLOAD_ALIGN - (offset % PAYLOAD_ALIGN)) & (PAYLOAD_ALIGN - 1); But my C-foo is not strong enough to judge potential corner cases. Regards, Frank -- Frank Lichtenheld _______________________________________________ Openvpn-devel mailing list Openvpn-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openvpn-devel