K 10 svn:author V 2 ae K 8 svn:date V 27 2016-12-28T16:30:08.957981Z K 7 svn:log V 888 Add ipsec_prepend() - optimized version of M_PREPEND(). We use M_PREPEND() to prepend outer IP header for tunnel mode SA. This may lead to allocation of new mbuf, that will be aligned to the end of mbuf's data, i.e. all unused space is at the beginning of the mbuf. After IP encapsulation some IPsec transforms is performed. This inserts new ESP/AH/IPCOMP header just after outer IP header. Since mbuf is aligned, m_makespace() needs to allocate new mbuf, or copy all data after outer IP header into new place to prepare the space for ESP/AH/IPCOMP header. To avoid this, ipsec_prepend() reserves space at the beginning to be able place link level header, and at the end, to be able place ESP/AH/IPCOMP header. Also modify m_makespace() to handle the case, when at the beginning of mbuf is enough space to move outer IP header, instead of moving all remaining data to the end of mbuf. END