mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
ofed/infiniband: fix ifdefs for new INET changes, fixing LINT-NOIP
Some of the ofed/infiniband code has INET and INET6 address handling code without using ifdefs. This failed with a recent change to INET, in which IN_LOOPBACK() started using a VNET variable, and which is not present if INET is not configured. Add #ifdef INET, and INET6 for good measure, in cma_loopback_addr(), along with inclusion of the options headers in ib_cma.c. Reviewed by: hselasky rgrimes bz Differential Revision: https://reviews.freebsd.org/D35835 (cherry picked from commit 752b7632776237f9c071783acdd1136ebf5f287d)
This commit is contained in:
parent
b1e81e6dde
commit
a11f080e86
1 changed files with 11 additions and 0 deletions
|
|
@ -40,6 +40,9 @@ __FBSDID("$FreeBSD$");
|
|||
|
||||
#define LINUXKPI_PARAM_PREFIX ibcore_
|
||||
|
||||
#include "opt_inet.h"
|
||||
#include "opt_inet6.h"
|
||||
|
||||
#include <linux/completion.h>
|
||||
#include <linux/in.h>
|
||||
#include <linux/in6.h>
|
||||
|
|
@ -1048,10 +1051,18 @@ static inline int cma_zero_addr(struct sockaddr *addr)
|
|||
static inline int cma_loopback_addr(struct sockaddr *addr)
|
||||
{
|
||||
switch (addr->sa_family) {
|
||||
#ifdef INET
|
||||
/*
|
||||
* ipv4_is_loopback() requires an inet variable via vnet,
|
||||
* not present if INET is not included.
|
||||
*/
|
||||
case AF_INET:
|
||||
return ipv4_is_loopback(((struct sockaddr_in *) addr)->sin_addr.s_addr);
|
||||
#endif
|
||||
#ifdef INET6
|
||||
case AF_INET6:
|
||||
return ipv6_addr_loopback(&((struct sockaddr_in6 *) addr)->sin6_addr);
|
||||
#endif
|
||||
case AF_IB:
|
||||
return ib_addr_loopback(&((struct sockaddr_ib *) addr)->sib_addr);
|
||||
default:
|
||||
|
|
|
|||
Loading…
Reference in a new issue