I would use an additional condition (source being an IPv6 address) instead of just combining both strings and relying on the fact that one of them is empty.