/* Shift @lpm right until @lpm and @mask have at least one bit in common or until @lpm is zero. Return the resulting lpm.  */
int lpm_adjust(int lpm, int mask)
/* Shift @lpm right until @lpm and @mask have at least one bit in common or until @lpm is zero. Return the resulting lpm.  */
int lpm_adjust(int lpm, int mask)
{
	while (lpm && ((lpm & mask) == 0))
		lpm >>= 1;
	return lpm;
}