We shouldn't just check the length and thus assume a certain layout. It's better to switch on the family, whether it's AF_INET or AF_INET6