aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/netdevsim
diff options
context:
space:
mode:
authorYueHaibing <yuehaibing@huawei.com>2019-08-20 22:14:46 +0800
committerDavid S. Miller <davem@davemloft.net>2019-08-20 13:46:32 -0700
commitd9bd6d279236a1c90c1e73220c2ae52996c8ff52 (patch)
tree16ce982931a60e3d19e7d66ae894ed058ba97ee8 /drivers/net/netdevsim
parentMerge branch 'net-dsa-enable-and-disable-all-ports' (diff)
downloadlinux-dev-d9bd6d279236a1c90c1e73220c2ae52996c8ff52.tar.xz
linux-dev-d9bd6d279236a1c90c1e73220c2ae52996c8ff52.zip
netdevsim: Fix build error without CONFIG_INET
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 <hulkci@huawei.com> Fixes: da58f90f11f5 ("netdevsim: Add devlink-trap support") Signed-off-by: YueHaibing <yuehaibing@huawei.com> Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com> Reviewed-by: Ido Schimmel <idosch@mellanox.com> Tested-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/netdevsim')
-rw-r--r--drivers/net/netdevsim/dev.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/netdevsim/dev.c b/drivers/net/netdevsim/dev.c
index c5b026150bf5..39cdb6c18ec0 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));