Apparently ntohs did not evaluate to a  constant on all platforms -> moved the tpo_header struct definition back inside function. Slight performance loss on some platforms but oh well.