Compile fix for LINT-NOIP kernel target.

Sponsored by:	Mellanox Technologies
This commit is contained in:
Hans Petter Selasky 2017-11-24 12:05:49 +00:00
parent fd9e423c88
commit e5806bf466
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/projects/bsd_rdma_4_9/; revision=326159
3 changed files with 8 additions and 0 deletions

View File

@ -168,7 +168,9 @@ roce_gid_update_addr_callback(struct ib_device *device, u8 port,
};
struct ipx_entry *entry;
struct net_device *idev;
#if defined(INET) || defined(INET6)
struct ifaddr *ifa;
#endif
union ib_gid gid;
int default_gids;
u16 index_num;

View File

@ -282,6 +282,7 @@ static const struct ib_field deth_table[] = {
__sum16 ib_ud_ip4_csum(struct ib_ud_header *header)
{
#if defined(INET) || defined(INET6)
struct ip iph;
iph.ip_hl = 5;
@ -297,6 +298,9 @@ __sum16 ib_ud_ip4_csum(struct ib_ud_header *header)
iph.ip_dst.s_addr = header->ip4.daddr;
return in_cksum_hdr(&iph);
#else
return 0;
#endif
}
EXPORT_SYMBOL(ib_ud_ip4_csum);

View File

@ -355,7 +355,9 @@ static int ib_get_header_version(const union rdma_network_hdr *hdr)
*/
memcpy(&ip4h_checked, ip4h, sizeof(ip4h_checked));
ip4h_checked.ip_sum = 0;
#if defined(INET) || defined(INET6)
ip4h_checked.ip_sum = in_cksum_hdr(&ip4h_checked);
#endif
/* if IPv4 header checksum is OK, believe it */
if (ip4h->ip_sum == ip4h_checked.ip_sum)
return 4;