Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp4120803ybl; Tue, 20 Aug 2019 07:18:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqxX3E6js/CioU8mSRPR40tmF2xeRhTBxDvl1OTOU/M1g85h2enu4sPtWvHWHxniGxDCWZum X-Received: by 2002:a17:902:8543:: with SMTP id d3mr29262309plo.80.1566310686747; Tue, 20 Aug 2019 07:18:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566310686; cv=none; d=google.com; s=arc-20160816; b=BOh/Ry1kqe7hjsRVjaIUximvfUUu4zufyWmcyX9RFgJ7A4NWlOp9+ztVQ66rjiUZa9 IdyMdwrWcgS4CLlGOeW/C64Eae4D2/4rtfqTOBbBtag1TjDASctPE/JvYCnaqGbQruKK rhIwPTsYHbPFN9gQEzeljTqxfFr5ZVCwWIlH0YDnxsiXnbIkhylXwGEPDVrp66guI3ga +ZFeNaGFiulyyqagjEBPLI6C+5Dma5mp4h+oiOUbcZ1qY5KVgjawNoyiQ44e6wgQsiK3 ukfrmu1dNb/m+gunuxKrEkMr4hcVbw3139vH3g3lH+Sonc7MBdPwn1JmVV50kQRRpEaf ZGHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=BYzMpFJd8GoUdHHQo50b/tvlrELNJVRVNsBHXxh+f2c=; b=See9hHxQyaGkENXICT6ppVUS8aAclehvcVeOT2pUGNqhktw8PfCBNmaHdU/eL5SPSo 6bcCPNVRmLmIMqnyN2xzOMRrTKDkjQah+OMfuxC3/CYT9xF8zMNg4t5CWpA/meRtjVXc NoDBq/Yxe9J+s0MXOZqLECZ6Adegg5zcybqAxdJjzm0v8rJ6ONW8fZMjfZKpsHi/KJul vK6aeGWRK/pJNtBJYDGfQJKobvGeRkQgmt1gLGbYlK6nf8d8djJ3KYsCn+v6oVp4E6qh I2aWu5Cc6+Zk5n8zylD0plV4iS5AZ+Oj/qUvy6zZw91yn2MeGZ58+KloMTZAb8H2yLvQ 6AGA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s13si13287826pfe.140.2019.08.20.07.17.51; Tue, 20 Aug 2019 07:18:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730226AbfHTOQz (ORCPT + 99 others); Tue, 20 Aug 2019 10:16:55 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:4737 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729762AbfHTOQy (ORCPT ); Tue, 20 Aug 2019 10:16:54 -0400 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id B7B5DFB8E5CA0C1399FE; Tue, 20 Aug 2019 22:16:51 +0800 (CST) Received: from localhost (10.133.213.239) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.439.0; Tue, 20 Aug 2019 22:16:41 +0800 From: YueHaibing To: , , , , CC: , , YueHaibing Subject: [PATCH v2 net-next] netdevsim: Fix build error without CONFIG_INET Date: Tue, 20 Aug 2019 22:14:46 +0800 Message-ID: <20190820141446.71604-1-yuehaibing@huawei.com> X-Mailer: git-send-email 2.10.2.windows.1 In-Reply-To: <20190819120825.74460-1-yuehaibing@huawei.com> References: <20190819120825.74460-1-yuehaibing@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.133.213.239] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If CONFIG_INET is not set, building fails: drivers/net/netdevsim/dev.o: In function `nsim_dev_trap_report_work': dev.c:(.text+0x67b): undefined reference to `ip_send_check' Use ip_fast_csum instead of ip_send_check to avoid dependencies on CONFIG_INET. Reported-by: Hulk Robot Fixes: da58f90f11f5 ("netdevsim: Add devlink-trap support") Signed-off-by: YueHaibing --- v2: use ip_fast_csum instead of ip_send_check --- drivers/net/netdevsim/dev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/netdevsim/dev.c b/drivers/net/netdevsim/dev.c index c5b0261..39cdb6c 100644 --- a/drivers/net/netdevsim/dev.c +++ b/drivers/net/netdevsim/dev.c @@ -389,7 +389,8 @@ static struct sk_buff *nsim_dev_trap_skb_build(void) iph->ihl = 0x5; iph->tot_len = htons(tot_len); iph->ttl = 100; - ip_send_check(iph); + iph->check = 0; + iph->check = ip_fast_csum((unsigned char *)iph, iph->ihl); udph = skb_put_zero(skb, sizeof(struct udphdr) + data_len); get_random_bytes(&udph->source, sizeof(u16)); -- 2.7.4