This change adds a fair amount of duplication. Using a regular expression like `inet6(?: addr:)?` would collapse this statement which would be a bit cleaner.