True, my test case was creating a Pub socket with Address Family AF_SP_RAW (there is no xpub). I was getting EINVAL and was expected EAFNOSUPPORT.
This is what did the patch, but I think it is a bit awkward : in fact we return EINVAL in all error cases except when there is an existing domain (AF_SP when only two AF), that way when there is an existing address familly for the protocol (the protocol exists) but not the expected address familly (AF_SP_RAW) we return EAFNOSUPPORT.