[PATCH v2] Standardize socket family checks