Commit d9bd6d27 authored by YueHaibing's avatar YueHaibing Committed by David S. Miller

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: default avatarHulk Robot <hulkci@huawei.com>
Fixes: da58f90f ("netdevsim: Add devlink-trap support")
Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
Acked-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: default avatarIdo Schimmel <idosch@mellanox.com>
Tested-by: default avatarIdo Schimmel <idosch@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b1b5133d
...@@ -389,7 +389,8 @@ static struct sk_buff *nsim_dev_trap_skb_build(void) ...@@ -389,7 +389,8 @@ static struct sk_buff *nsim_dev_trap_skb_build(void)
iph->ihl = 0x5; iph->ihl = 0x5;
iph->tot_len = htons(tot_len); iph->tot_len = htons(tot_len);
iph->ttl = 100; 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); udph = skb_put_zero(skb, sizeof(struct udphdr) + data_len);
get_random_bytes(&udph->source, sizeof(u16)); get_random_bytes(&udph->source, sizeof(u16));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment