Changeset View
Changeset View
Standalone View
Standalone View
sys/ofed/drivers/infiniband/core/ib_addr.c
Show All 40 Lines | |||||
#include <linux/mutex.h> | #include <linux/mutex.h> | ||||
#include <linux/slab.h> | #include <linux/slab.h> | ||||
#include <linux/workqueue.h> | #include <linux/workqueue.h> | ||||
#include <linux/module.h> | #include <linux/module.h> | ||||
#include <net/if_llatbl.h> | #include <net/if_llatbl.h> | ||||
#include <net/route.h> | #include <net/route.h> | ||||
#include <net/route/nhop.h> | #include <net/route/nhop.h> | ||||
#include <net/netevent.h> | #include <net/netevent.h> | ||||
#include <net/if_llatbl.h> | |||||
#include <rdma/ib_addr.h> | #include <rdma/ib_addr.h> | ||||
#include <rdma/ib.h> | #include <rdma/ib.h> | ||||
#include <netinet/in_fib.h> | #include <netinet/in_fib.h> | ||||
#include <netinet/if_ether.h> | #include <netinet/if_ether.h> | ||||
#include <netinet/ip_var.h> | #include <netinet/ip_var.h> | ||||
#include <netinet6/scope6_var.h> | #include <netinet6/scope6_var.h> | ||||
#include <netinet6/in6_pcb.h> | #include <netinet6/in6_pcb.h> | ||||
▲ Show 20 Lines • Show All 335 Lines • ▼ Show 20 Lines | if (dst_tmp.sin_addr.s_addr == INADDR_BROADCAST) { | ||||
else if (is_gw) | else if (is_gw) | ||||
addr->network = RDMA_NETWORK_IPV4; | addr->network = RDMA_NETWORK_IPV4; | ||||
} else if (ifp->if_flags & IFF_LOOPBACK) { | } else if (ifp->if_flags & IFF_LOOPBACK) { | ||||
memset(edst, 0, MAX_ADDR_LEN); | memset(edst, 0, MAX_ADDR_LEN); | ||||
error = 0; | error = 0; | ||||
} else { | } else { | ||||
bool is_gw = (nh->nh_flags & NHF_GATEWAY) != 0; | bool is_gw = (nh->nh_flags & NHF_GATEWAY) != 0; | ||||
memset(edst, 0, MAX_ADDR_LEN); | memset(edst, 0, MAX_ADDR_LEN); | ||||
#ifdef INET6 | |||||
if (is_gw && nh->gw_sa.sa_family == AF_INET6) | |||||
error = nd6_resolve(ifp, LLE_SF(AF_INET, is_gw), NULL, | |||||
&nh->gw_sa, edst, NULL, NULL); | |||||
else | |||||
#endif | |||||
error = arpresolve(ifp, is_gw, NULL, is_gw ? | error = arpresolve(ifp, is_gw, NULL, is_gw ? | ||||
&nh->gw_sa : (const struct sockaddr *)&dst_tmp, | &nh->gw_sa : (const struct sockaddr *)&dst_tmp, | ||||
zlei: Might be better if `nd6_resolve()` return with correct ether type ? | |||||
Done Inline ActionsThis is in D31379 IIUC. zlei: This is in D31379 IIUC. | |||||
edst, NULL, NULL); | edst, NULL, NULL); | ||||
if (error != 0) | if (error != 0) | ||||
goto error_put_ifp; | goto error_put_ifp; | ||||
else if (is_gw) | else if (is_gw) | ||||
addr->network = RDMA_NETWORK_IPV4; | addr->network = RDMA_NETWORK_IPV4; | ||||
} | } | ||||
/* | /* | ||||
* Step 4 - update source address, if any | * Step 4 - update source address, if any | ||||
▲ Show 20 Lines • Show All 498 Lines • Show Last 20 Lines |
Might be better if nd6_resolve() return with correct ether type ?