Did you just review the code or you also tested it?
It covers the cases when enable_double_rr is 1 (or different than 0) and there is no second Route header. Because if there is a second route, then the socket is forced later to the outgoing socket.