https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=276363

Kyle Evans <kev...@freebsd.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kev...@freebsd.org

--- Comment #2 from Kyle Evans <kev...@freebsd.org> ---
(In reply to Aaron LI from comment #1)

I would perhaps reorganize it slightly at that point:

static inline unsigned int                                                      
calculate_padding(struct wg_packet *pkt)                                        
{                                                                               
        unsigned int padded_size, last_unit = pkt->p_mbuf->m_pkthdr.len;        

        padded_size = (last_unit + (WG_PKT_PADDING - 1)) & ~(WG_PKT_PADDING -
1);

        if (__predict_true(pkt->p_mtu != 0)) {                                  
                if (__predict_false(last_unit > pkt->p_mtu))                    
                        last_unit %= pkt->p_mtu;                                

                if (pkt->p_mtu < padded_size)                                   
                        padded_size = pkt->p_mtu;                               
        }                                                                       

        return (padded_size - last_unit);                                       
}

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to