brcompatd: Factor code out of handle_fdb_query_cmd().