lpm: fix big endian support