[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f6c1dbe5-ba6f-6e68-aa3b-4fe018d5092f@kernel.org>
Date: Wed, 16 Mar 2022 21:56:06 -0600
From: David Ahern <dsahern@...nel.org>
To: menglong8.dong@...il.com, kuba@...nel.org, pabeni@...hat.com
Cc: rostedt@...dmis.org, mingo@...hat.com, xeb@...l.ru,
davem@...emloft.net, yoshfuji@...ux-ipv6.org,
imagedong@...cent.com, edumazet@...gle.com, kafai@...com,
talalahmad@...gle.com, keescook@...omium.org, alobakin@...me,
flyingpeng@...cent.com, mengensun@...cent.com,
dongli.zhang@...cle.com, linux-kernel@...r.kernel.org,
netdev@...r.kernel.org, benbjiang@...cent.com
Subject: Re: [PATCH net-next v3 2/3] net: icmp: introduce
__ping_queue_rcv_skb() to report drop reasons
On 3/16/22 12:31 AM, menglong8.dong@...il.com wrote:
> diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c
> index 3ee947557b88..9a1ea6c263f8 100644
> --- a/net/ipv4/ping.c
> +++ b/net/ipv4/ping.c
> @@ -934,16 +934,24 @@ int ping_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, int noblock,
> }
> EXPORT_SYMBOL_GPL(ping_recvmsg);
>
> -int ping_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
> +static enum skb_drop_reason __ping_queue_rcv_skb(struct sock *sk,
> + struct sk_buff *skb)
> {
> + enum skb_drop_reason reason;
> +
> pr_debug("ping_queue_rcv_skb(sk=%p,sk->num=%d,skb=%p)\n",
> inet_sk(sk), inet_sk(sk)->inet_num, skb);
> - if (sock_queue_rcv_skb(sk, skb) < 0) {
> - kfree_skb(skb);
> + if (sock_queue_rcv_skb_reason(sk, skb, &reason) < 0) {
> + kfree_skb_reason(skb, reason);
> pr_debug("ping_queue_rcv_skb -> failed\n");
> - return -1;
> + return reason;
> }
> - return 0;
> + return SKB_NOT_DROPPED_YET;
> +}
> +
> +int ping_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
> +{
> + return __ping_queue_rcv_skb(sk, skb) ?: -1;
> }
> EXPORT_SYMBOL_GPL(ping_queue_rcv_skb);
>
This is a generic proto callback and you are now changing its return
code in a way that seems to conflict with existing semantics
Powered by blists - more mailing lists