Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/cxgbe/tom/t4_listen.c
Show First 20 Lines • Show All 1,046 Lines • ▼ Show 20 Lines | |||||
static struct l2t_entry * | static struct l2t_entry * | ||||
get_l2te_for_nexthop(struct port_info *pi, struct ifnet *ifp, | get_l2te_for_nexthop(struct port_info *pi, struct ifnet *ifp, | ||||
struct in_conninfo *inc) | struct in_conninfo *inc) | ||||
{ | { | ||||
struct l2t_entry *e; | struct l2t_entry *e; | ||||
struct sockaddr_in6 sin6; | struct sockaddr_in6 sin6; | ||||
struct sockaddr *dst = (void *)&sin6; | struct sockaddr *dst = (void *)&sin6; | ||||
struct nhop_object *nh; | |||||
if (inc->inc_flags & INC_ISIPV6) { | if (inc->inc_flags & INC_ISIPV6) { | ||||
struct nhop6_basic nh6; | |||||
bzero(dst, sizeof(struct sockaddr_in6)); | bzero(dst, sizeof(struct sockaddr_in6)); | ||||
dst->sa_len = sizeof(struct sockaddr_in6); | dst->sa_len = sizeof(struct sockaddr_in6); | ||||
dst->sa_family = AF_INET6; | dst->sa_family = AF_INET6; | ||||
if (IN6_IS_ADDR_LINKLOCAL(&inc->inc6_laddr)) { | if (IN6_IS_ADDR_LINKLOCAL(&inc->inc6_laddr)) { | ||||
/* no need for route lookup */ | /* no need for route lookup */ | ||||
e = t4_l2t_get(pi, ifp, dst); | e = t4_l2t_get(pi, ifp, dst); | ||||
return (e); | return (e); | ||||
} | } | ||||
if (fib6_lookup_nh_basic(RT_DEFAULT_FIB, &inc->inc6_faddr, | nh = fib6_lookup(RT_DEFAULT_FIB, &inc->inc6_faddr, 0, NHR_NONE, 0); | ||||
0, 0, 0, &nh6) != 0) | if (nh == NULL) | ||||
return (NULL); | return (NULL); | ||||
if (nh6.nh_ifp != ifp) | if (nh->nh_ifp != ifp) | ||||
return (NULL); | return (NULL); | ||||
((struct sockaddr_in6 *)dst)->sin6_addr = nh6.nh_addr; | if (nh->nh_flags & NHF_GATEWAY) | ||||
((struct sockaddr_in6 *)dst)->sin6_addr = nh->gw6_sa.sin6_addr; | |||||
else | |||||
((struct sockaddr_in6 *)dst)->sin6_addr = inc->inc6_faddr; | |||||
} else { | } else { | ||||
struct nhop4_basic nh4; | |||||
dst->sa_len = sizeof(struct sockaddr_in); | dst->sa_len = sizeof(struct sockaddr_in); | ||||
dst->sa_family = AF_INET; | dst->sa_family = AF_INET; | ||||
if (fib4_lookup_nh_basic(RT_DEFAULT_FIB, inc->inc_faddr, 0, 0, | nh = fib4_lookup(RT_DEFAULT_FIB, inc->inc_faddr, 0, NHR_NONE, 0); | ||||
&nh4) != 0) | if (nh == NULL) | ||||
return (NULL); | return (NULL); | ||||
if (nh4.nh_ifp != ifp) | if (nh->nh_ifp != ifp) | ||||
return (NULL); | return (NULL); | ||||
((struct sockaddr_in *)dst)->sin_addr = nh4.nh_addr; | if (nh->nh_flags & NHF_GATEWAY) | ||||
((struct sockaddr_in *)dst)->sin_addr = nh->gw_sa.sin_addr; | |||||
np: This should be gw4_sa or it won't compile:
t4_listen.o… | |||||
else | |||||
((struct sockaddr_in *)dst)->sin_addr = inc->inc_faddr; | |||||
} | } | ||||
e = t4_l2t_get(pi, ifp, dst); | e = t4_l2t_get(pi, ifp, dst); | ||||
return (e); | return (e); | ||||
} | } | ||||
static int | static int | ||||
send_synack(struct adapter *sc, struct synq_entry *synqe, uint64_t opt0, | send_synack(struct adapter *sc, struct synq_entry *synqe, uint64_t opt0, | ||||
▲ Show 20 Lines • Show All 440 Lines • Show Last 20 Lines |
This should be gw4_sa or it won't compile:
t4_listen.o ---
/root/ws/head/sys/dev/cxgbe/tom/t4_listen.c:1088:54: error: no member named 'sin_addr' in 'struct sockaddr'
1 error generated.