On 22.06.2022 16:38, Rahul Singh wrote:
> @@ -387,8 +392,19 @@ int evtchn_bind_interdomain(evtchn_bind_interdomain_t
> *bind)
> spin_lock(&ld->event_lock);
> }
>
> - if ( (lport = get_free_port(ld)) < 0 )
> - ERROR_EXIT(lport);
> + if ( lport != 0 )
> + {
> + if ( (rc = evtchn_allocate_port(ld, lport)) != 0 )
> + ERROR_EXIT_DOM(rc, ld);
> + }
> + else
> + {
> + int alloc_port = get_free_port(ld);
> +
> + if ( alloc_port < 0 )
> + ERROR_EXIT_DOM(alloc_port, ld);
> + lport = alloc_port;
> + }
This is then the 3rd instance of this pattern. I think the logic
wants moving into get_free_port() (perhaps with a name change).
And of course like in the earlier patch the issue with sparse port
numbers needs to be resolved.
Jan