[PATCH v5 1/2] nsiproxy: Fill the reply with exact ICMP_ECHO_REPLY in the output buffer.

Huw Davies huw at codeweavers.com
Mon Nov 8 04:54:39 CST 2021


On Mon, Oct 25, 2021 at 07:26:47PM +0300, Gabriel Ivăncescu wrote:
> @@ -372,9 +384,23 @@ static void handle_queued_send_echo( IRP *irp )
>          irp->IoStatus.Status = status;
>          if (status == STATUS_SUCCESS)
>          {
> -            memset( reply, 0, sizeof(*reply) );
> -            reply->status = params.ip_status;
> -            irp->IoStatus.Information = sizeof(*reply);
> +            if (family == AF_INET)
> +            {
> +                if (bits == 32)
> +                {
> +                    struct icmp_echo_reply_32 *reply = out;
> +                    memset( reply, 0, sizeof(*reply) );
> +                    reply->status = params.ip_status;
> +                    irp->IoStatus.Information = sizeof(*reply);
> +                }
> +                else
> +                {
> +                    struct icmp_echo_reply_64 *reply = out;
> +                    memset( reply, 0, sizeof(*reply) );
> +                    reply->status = params.ip_status;
> +                    irp->IoStatus.Information = sizeof(*reply);
> +                }
> +            }

Given that this has increased in complexity, I think it would now make
sense to do this on the unix-side (it was a bit of a toss-up even
before this change).  Obviously you'd now need to pass "out" and
"bits" to the syscall.  Additionally this patch could be split.  For
example, one could add the new ops before changing any functionality.

Huw.



More information about the wine-devel mailing list