Deleted Added
full compact
34c34
< * $FreeBSD: head/sys/netinet/tcp_timewait.c 77900 2001-06-08 05:24:21Z peter $
---
> * $FreeBSD: head/sys/netinet/tcp_timewait.c 78064 2001-06-11 12:39:29Z ume $
446c446,449
< ipsec_setsocket(m, tp ? tp->t_inpcb->inp_socket : NULL);
---
> if (ipsec_setsocket(m, tp ? tp->t_inpcb->inp_socket : NULL) != 0) {
> m_freem(m);
> return;
> }
1023d1025
< register struct tcphdr *thp;
1026d1027
< struct sockaddr_in6 sa6;
1028a1030,1031
> struct ip6ctlparam *ip6cp = NULL;
> const struct sockaddr_in6 *sa6_src = NULL;
1029a1033,1036
> struct tcp_portonly {
> u_int16_t th_sport;
> u_int16_t th_dport;
> } *thp;
1045c1052
< struct ip6ctlparam *ip6cp = (struct ip6ctlparam *)d;
---
> ip6cp = (struct ip6ctlparam *)d;
1048a1056
> sa6_src = ip6cp->ip6c_src;
1052a1061
> sa6_src = &sa6_any;
1055,1063d1063
< /*
< * Translate addresses into internal form.
< * Sa check if it is AF_INET6 is done at the top of this funciton.
< */
< sa6 = *(struct sockaddr_in6 *)sa;
< if (IN6_IS_ADDR_LINKLOCAL(&sa6.sin6_addr) != 0 && m != NULL &&
< m->m_pkthdr.rcvif != NULL)
< sa6.sin6_addr.s6_addr16[1] = htons(m->m_pkthdr.rcvif->if_index);
<
1069d1068
< struct in6_addr s;
1071,1076d1069
< /* translate addresses into internal form */
< memcpy(&s, &ip6->ip6_src, sizeof(s));
< if (IN6_IS_ADDR_LINKLOCAL(&s) != 0 && m != NULL &&
< m->m_pkthdr.rcvif != NULL)
< s.s6_addr16[1] = htons(m->m_pkthdr.rcvif->if_index);
<
1078c1071
< if (m->m_pkthdr.len < off + sizeof(th))
---
> if (m->m_pkthdr.len < off + sizeof(*thp))
1081,1092c1074,1079
< if (m->m_len < off + sizeof(th)) {
< /*
< * this should be rare case
< * because now MINCLSIZE is "(MHLEN + 1)",
< * so we compromise on this copy...
< */
< m_copydata(m, off, sizeof(th), (caddr_t)&th);
< thp = &th;
< } else
< thp = (struct tcphdr *)(mtod(m, caddr_t) + off);
< in6_pcbnotify(&tcb, (struct sockaddr *)&sa6, thp->th_dport,
< &s, thp->th_sport, cmd, notify);
---
> bzero(&th, sizeof(th));
> m_copydata(m, off, sizeof(*thp), (caddr_t)&th);
>
> in6_pcbnotify(&tcb, sa, th.th_dport,
> (struct sockaddr *)ip6cp->ip6c_src,
> th.th_sport, cmd, notify);
1094c1081
< in6_pcbnotify(&tcb, (struct sockaddr *)&sa6, 0, &zeroin6_addr,
---
> in6_pcbnotify(&tcb, sa, 0, (struct sockaddr *)sa6_src,
1326,1328c1313,1318
< ro6->ro_dst.sin6_family = AF_INET6;
< ro6->ro_dst.sin6_len = sizeof(ro6->ro_dst);
< ro6->ro_dst.sin6_addr = inp->in6p_faddr;
---
> struct sockaddr_in6 *dst6;
>
> dst6 = (struct sockaddr_in6 *)&ro6->ro_dst;
> dst6->sin6_family = AF_INET6;
> dst6->sin6_len = sizeof(ro6->ro_dst);
> dst6->sin6_addr = inp->in6p_faddr;
1378a1369
> ip->ip_vhl = IP_VHL_BORING;