Re: [PATCH v2] skmsg: lose offset info in sk_psock_skb_ingress

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Sep 17, 2021 at 3:05 AM Liu Jian <liujian56@xxxxxxxxxx> wrote:
> @@ -624,6 +635,13 @@ static void sk_psock_backlog(struct work_struct *work)
>         while ((skb = skb_dequeue(&psock->ingress_skb))) {
>                 len = skb->len;
>                 off = 0;
> +#if IS_ENABLED(CONFIG_BPF_STREAM_PARSER)
> +               if (psock->sk->sk_data_ready == sk_psock_strp_data_ready) {
> +                       stm = strp_msg(skb);
> +                       off = stm->offset;
> +                       len = stm->full_len;
> +               }
> +#endif

How does this work? You are testing psock->sk->sk_data_ready here
but it is already the dest sock here, so, if we redirect a strp_msg() from
strp socket to non-strp socket, this does not work at all?

And this code looks ugly itself. If you want to distinguish this type of
packet from others, you can add a bit in, for example skb->_sk_redir.

Thanks.



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux