Routing socket messages are padded to sizeof(long), not just

sizeof(u_int32_t).
This commit is contained in:
Bill Fenner 2002-07-30 04:49:13 +00:00
parent c02a3aa562
commit d3125a3e10
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=100905

View File

@ -29,6 +29,8 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD$
*/
/* XXX Yes this is WAY too complicated */
@ -193,9 +195,9 @@ findsaddr(register const struct sockaddr_in *to,
}
if (SALEN(sa) == 0)
cp += sizeof(u_int32_t);
cp += sizeof(long);
else
cp += roundup(SALEN(sa), sizeof(u_int32_t));
cp += roundup(SALEN(sa), sizeof(long));
}
return ("failed!");