From patchwork Tue Feb 11 15:00:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jason A. Donenfeld" X-Patchwork-Id: 1236318 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=zx2c4.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=zx2c4.com header.i=@zx2c4.com header.a=rsa-sha1 header.s=mail header.b=dovs/oz2; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 48H5Yt1xD2z9sP7 for ; Wed, 12 Feb 2020 02:00:50 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730026AbgBKPAt (ORCPT ); Tue, 11 Feb 2020 10:00:49 -0500 Received: from frisell.zx2c4.com ([192.95.5.64]:34135 "EHLO frisell.zx2c4.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728073AbgBKPAt (ORCPT ); Tue, 11 Feb 2020 10:00:49 -0500 Received: by frisell.zx2c4.com (ZX2C4 Mail Server) with ESMTP id dd66e016; Tue, 11 Feb 2020 14:59:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=zx2c4.com; h=from:to:cc :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=mail; bh=JzV6toZzstw9vzB/ziu+YJh5G mY=; b=dovs/oz2vUL3klrd1VlAbhcgO9Iz0Zo6IoF576bOZEQtWLc8IfPDhH2vk zlllqR2eK//rIsfPHYSdxi8oTRKXfnlerEh1GFT5ILy7fgJbMj6uuA2f4vWEsUP0 5Xmc8ERs3FmVGVjANcjmOAEyjy5K8p5znhjbOHLJLhHUcO2lfY58FfJw5xYeiV3b eHazUCL3Na/pA+wQ+P4c6Gsok4Gm1S10jXMqMMH9fvyXG21/da13JovqFsDXPVsr LnsmpRkxevkzhcP/nYx9DESj4iyBYJVNVmq39iUWikY15DL+iyLfRueEH9XISDXu jRY4jewcpObkNkZwaciEZLlZtTBPg== Received: by frisell.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 51f42231 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO); Tue, 11 Feb 2020 14:59:03 +0000 (UTC) From: "Jason A. Donenfeld" To: netdev@vger.kernel.org, davem@davemloft.net Cc: "Jason A. Donenfeld" , Harald Welte Subject: [PATCH v3 net 2/9] gtp: use icmp_ndo_send helper Date: Tue, 11 Feb 2020 16:00:21 +0100 Message-Id: <20200211150028.688073-3-Jason@zx2c4.com> In-Reply-To: <20200211150028.688073-1-Jason@zx2c4.com> References: <20200210141423.173790-2-Jason@zx2c4.com> <20200211150028.688073-1-Jason@zx2c4.com> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Because gtp is calling icmp from network device context, it should use the ndo helper so that the rate limiting applies correctly. Signed-off-by: Jason A. Donenfeld Cc: Harald Welte --- drivers/net/gtp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index af07ea760b35..672cd2caf2fb 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -546,8 +546,8 @@ static int gtp_build_skb_ip4(struct sk_buff *skb, struct net_device *dev, mtu < ntohs(iph->tot_len)) { netdev_dbg(dev, "packet too big, fragmentation needed\n"); memset(IPCB(skb), 0, sizeof(*IPCB(skb))); - icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED, - htonl(mtu)); + icmp_ndo_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED, + htonl(mtu)); goto err_rt; }