If I understand the code correctly, a destination record that matches only the socket is selected against one that matches address/port/proto? Is it like that and if yes, is it the expected result?
Yes, it is a separate flag - DS_MATCH_SOCKET (8), it work like ds_is_from_list(-1,0), but socket is take in account also (if specified in the configuration).