Changeset View
Changeset View
Standalone View
Standalone View
head/sys/netinet6/in6_pcb.c
Show First 20 Lines • Show All 1,261 Lines • ▼ Show 20 Lines | |||||
#endif | #endif | ||||
} | } | ||||
#endif | #endif | ||||
return (in6_pcblookup_hash(pcbinfo, faddr, fport, laddr, lport, | return (in6_pcblookup_hash(pcbinfo, faddr, fport, laddr, lport, | ||||
lookupflags, ifp)); | lookupflags, ifp)); | ||||
} | } | ||||
void | void | ||||
init_sin6(struct sockaddr_in6 *sin6, struct mbuf *m) | init_sin6(struct sockaddr_in6 *sin6, struct mbuf *m, int srcordst) | ||||
{ | { | ||||
struct ip6_hdr *ip; | struct ip6_hdr *ip; | ||||
ip = mtod(m, struct ip6_hdr *); | ip = mtod(m, struct ip6_hdr *); | ||||
bzero(sin6, sizeof(*sin6)); | bzero(sin6, sizeof(*sin6)); | ||||
sin6->sin6_len = sizeof(*sin6); | sin6->sin6_len = sizeof(*sin6); | ||||
sin6->sin6_family = AF_INET6; | sin6->sin6_family = AF_INET6; | ||||
sin6->sin6_addr = ip->ip6_src; | sin6->sin6_addr = srcordst ? ip->ip6_dst : ip->ip6_src; | ||||
(void)sa6_recoverscope(sin6); /* XXX: should catch errors... */ | (void)sa6_recoverscope(sin6); /* XXX: should catch errors... */ | ||||
return; | return; | ||||
} | } |