1/*
2 * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
--- 17 unchanged lines hidden (view full) ---
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * @(#)tcp_output.c 8.4 (Berkeley) 5/24/95
34 * $FreeBSD: head/sys/netinet/tcp_output.c 105194 2002-10-16 01:54:46Z sam $
35 */
36
37#include "opt_inet6.h"
38#include "opt_ipsec.h"
39#include "opt_mac.h"
40#include "opt_tcpdebug.h"
41
42#include <sys/param.h>
--- 827 unchanged lines hidden (view full) ---
870 * Neighbor Discovery.
871 */
872 ip6->ip6_hlim = in6_selecthlim(tp->t_inpcb,
873 tp->t_inpcb->in6p_route.ro_rt ?
874 tp->t_inpcb->in6p_route.ro_rt->rt_ifp
875 : NULL);
876
877 /* TODO: IPv6 IP6TOS_ECT bit on */
878 error = ip6_output(m,
879 tp->t_inpcb->in6p_outputopts,
880 &tp->t_inpcb->in6p_route,
881 (so->so_options & SO_DONTROUTE), NULL, NULL,
882 tp->t_inpcb);
883 } else
884#endif /* INET6 */
885 {
886 struct rtentry *rt;
887 ip->ip_len = m->m_pkthdr.len;
888#ifdef INET6
889 if (INP_CHECK_SOCKAF(so, AF_INET6))
890 ip->ip_ttl = in6_selecthlim(tp->t_inpcb,
--- 12 unchanged lines hidden (view full) ---
903 * disabled)
904 */
905 if (path_mtu_discovery
906 && (rt = tp->t_inpcb->inp_route.ro_rt)
907 && rt->rt_flags & RTF_UP
908 && !(rt->rt_rmx.rmx_locks & RTV_MTU)) {
909 ip->ip_off |= IP_DF;
910 }
911 error = ip_output(m, tp->t_inpcb->inp_options, &tp->t_inpcb->inp_route,
912 (so->so_options & SO_DONTROUTE), 0, tp->t_inpcb);
913 }
914 if (error) {
915
916 /*
917 * We know that the packet was lost, so back out the
918 * sequence number advance, if any.
919 */
920 if (tp->t_force == 0 || !callout_active(tp->tt_persist)) {
--- 81 unchanged lines hidden ---
2 * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
--- 17 unchanged lines hidden (view full) ---
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * @(#)tcp_output.c 8.4 (Berkeley) 5/24/95
34 * $FreeBSD: head/sys/netinet/tcp_output.c 105194 2002-10-16 01:54:46Z sam $
35 */
36
37#include "opt_inet6.h"
38#include "opt_ipsec.h"
39#include "opt_mac.h"
40#include "opt_tcpdebug.h"
41
42#include <sys/param.h>
--- 827 unchanged lines hidden (view full) ---
870 * Neighbor Discovery.
871 */
872 ip6->ip6_hlim = in6_selecthlim(tp->t_inpcb,
873 tp->t_inpcb->in6p_route.ro_rt ?
874 tp->t_inpcb->in6p_route.ro_rt->rt_ifp
875 : NULL);
876
877 /* TODO: IPv6 IP6TOS_ECT bit on */
878 error = ip6_output(m,
879 tp->t_inpcb->in6p_outputopts,
880 &tp->t_inpcb->in6p_route,
881 (so->so_options & SO_DONTROUTE), NULL, NULL,
882 tp->t_inpcb);
883 } else
884#endif /* INET6 */
885 {
886 struct rtentry *rt;
887 ip->ip_len = m->m_pkthdr.len;
888#ifdef INET6
889 if (INP_CHECK_SOCKAF(so, AF_INET6))
890 ip->ip_ttl = in6_selecthlim(tp->t_inpcb,
--- 12 unchanged lines hidden (view full) ---
903 * disabled)
904 */
905 if (path_mtu_discovery
906 && (rt = tp->t_inpcb->inp_route.ro_rt)
907 && rt->rt_flags & RTF_UP
908 && !(rt->rt_rmx.rmx_locks & RTV_MTU)) {
909 ip->ip_off |= IP_DF;
910 }
911 error = ip_output(m, tp->t_inpcb->inp_options, &tp->t_inpcb->inp_route,
912 (so->so_options & SO_DONTROUTE), 0, tp->t_inpcb);
913 }
914 if (error) {
915
916 /*
917 * We know that the packet was lost, so back out the
918 * sequence number advance, if any.
919 */
920 if (tp->t_force == 0 || !callout_active(tp->tt_persist)) {
--- 81 unchanged lines hidden ---