Changeset View
Changeset View
Standalone View
Standalone View
sys/net/if_gre.c
Show First 20 Lines • Show All 606 Lines • ▼ Show 20 Lines | |||||
static int | static int | ||||
gre_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, | gre_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, | ||||
struct route *ro) | struct route *ro) | ||||
{ | { | ||||
uint32_t af; | uint32_t af; | ||||
if (dst->sa_family == AF_UNSPEC) | if (dst->sa_family == AF_UNSPEC) | ||||
bcopy(dst->sa_data, &af, sizeof(af)); | bcopy(dst->sa_data, &af, sizeof(af)); | ||||
else if (ro != NULL && ro->ro_flags & RT_HAS_GW) | |||||
af = ro->ro_dst.sa_family; | |||||
else | else | ||||
af = dst->sa_family; | af = dst->sa_family; | ||||
/* | /* | ||||
* Now save the af in the inbound pkt csum data, this is a cheat since | * Now save the af in the inbound pkt csum data, this is a cheat since | ||||
* we are using the inbound csum_data field to carry the af over to | * we are using the inbound csum_data field to carry the af over to | ||||
* the gre_transmit() routine, avoiding using yet another mtag. | * the gre_transmit() routine, avoiding using yet another mtag. | ||||
*/ | */ | ||||
m->m_pkthdr.csum_data = af; | m->m_pkthdr.csum_data = af; | ||||
▲ Show 20 Lines • Show All 219 Lines • Show Last 20 Lines |