tcp_output.c (243917fe3b5e36464ab72473e872da9acd44aa1c) | tcp_output.c (4cc20ab1f0f3d1126126327aa298ab88c974c53d) |
---|---|
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 --- 112 unchanged lines hidden (view full) --- 121#if 0 122 int maxburst = TCP_MAXBURST; 123#endif 124 struct rmxp_tao *taop; 125 struct rmxp_tao tao_noncached; 126#ifdef INET6 127 int isipv6; 128#endif | 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 --- 112 unchanged lines hidden (view full) --- 121#if 0 122 int maxburst = TCP_MAXBURST; 123#endif 124 struct rmxp_tao *taop; 125 struct rmxp_tao tao_noncached; 126#ifdef INET6 127 int isipv6; 128#endif |
129 int soopts; | |
130 131#ifdef INET6 132 isipv6 = (tp->t_inpcb->inp_vflag & INP_IPV6) != 0; 133#endif 134 135 /* 136 * Determine length of data that should be transmitted, 137 * and flags that will be used. --- 677 unchanged lines hidden (view full) --- 815 } else 816 if (SEQ_GT(tp->snd_nxt + len, tp->snd_max)) 817 tp->snd_max = tp->snd_nxt + len; 818 819#ifdef TCPDEBUG 820 /* 821 * Trace. 822 */ | 129 130#ifdef INET6 131 isipv6 = (tp->t_inpcb->inp_vflag & INP_IPV6) != 0; 132#endif 133 134 /* 135 * Determine length of data that should be transmitted, 136 * and flags that will be used. --- 677 unchanged lines hidden (view full) --- 814 } else 815 if (SEQ_GT(tp->snd_nxt + len, tp->snd_max)) 816 tp->snd_max = tp->snd_nxt + len; 817 818#ifdef TCPDEBUG 819 /* 820 * Trace. 821 */ |
823 SOCK_LOCK(so); 824 if (so->so_options & SO_DEBUG) { 825 SOCK_UNLOCK(so); | 822 if (so->so_options & SO_DEBUG) |
826 tcp_trace(TA_OUTPUT, tp->t_state, tp, mtod(m, void *), th, 0); | 823 tcp_trace(TA_OUTPUT, tp->t_state, tp, mtod(m, void *), th, 0); |
827 } else 828 SOCK_UNLOCK(so); | |
829#endif 830 831 /* 832 * Fill in IP length and desired time to live and 833 * send to IP level. There should be a better way 834 * to handle ttl and tos; we could keep them in 835 * the template, but need a way to checksum without them. 836 */ --- 17 unchanged lines hidden (view full) --- 854 /* TODO: IPv6 IP6TOS_ECT bit on */ 855#ifdef IPSEC 856 if (ipsec_setsocket(m, so) != 0) { 857 m_freem(m); 858 error = ENOBUFS; 859 goto out; 860 } 861#endif /*IPSEC*/ | 824#endif 825 826 /* 827 * Fill in IP length and desired time to live and 828 * send to IP level. There should be a better way 829 * to handle ttl and tos; we could keep them in 830 * the template, but need a way to checksum without them. 831 */ --- 17 unchanged lines hidden (view full) --- 849 /* TODO: IPv6 IP6TOS_ECT bit on */ 850#ifdef IPSEC 851 if (ipsec_setsocket(m, so) != 0) { 852 m_freem(m); 853 error = ENOBUFS; 854 goto out; 855 } 856#endif /*IPSEC*/ |
862 SOCK_LOCK(so); 863 soopts = (so->so_options & SO_DONTROUTE); 864 SOCK_UNLOCK(so); | |
865 error = ip6_output(m, 866 tp->t_inpcb->in6p_outputopts, 867 &tp->t_inpcb->in6p_route, | 857 error = ip6_output(m, 858 tp->t_inpcb->in6p_outputopts, 859 &tp->t_inpcb->in6p_route, |
868 soopts, NULL, NULL); | 860 (so->so_options & SO_DONTROUTE), NULL, NULL); |
869 } else 870#endif /* INET6 */ 871 { 872 struct rtentry *rt; 873 ip->ip_len = m->m_pkthdr.len; 874#ifdef INET6 875 if (INP_CHECK_SOCKAF(so, AF_INET6)) 876 ip->ip_ttl = in6_selecthlim(tp->t_inpcb, --- 15 unchanged lines hidden (view full) --- 892 && (rt = tp->t_inpcb->inp_route.ro_rt) 893 && rt->rt_flags & RTF_UP 894 && !(rt->rt_rmx.rmx_locks & RTV_MTU)) { 895 ip->ip_off |= IP_DF; 896 } 897#ifdef IPSEC 898 ipsec_setsocket(m, so); 899#endif /*IPSEC*/ | 861 } else 862#endif /* INET6 */ 863 { 864 struct rtentry *rt; 865 ip->ip_len = m->m_pkthdr.len; 866#ifdef INET6 867 if (INP_CHECK_SOCKAF(so, AF_INET6)) 868 ip->ip_ttl = in6_selecthlim(tp->t_inpcb, --- 15 unchanged lines hidden (view full) --- 884 && (rt = tp->t_inpcb->inp_route.ro_rt) 885 && rt->rt_flags & RTF_UP 886 && !(rt->rt_rmx.rmx_locks & RTV_MTU)) { 887 ip->ip_off |= IP_DF; 888 } 889#ifdef IPSEC 890 ipsec_setsocket(m, so); 891#endif /*IPSEC*/ |
900 SOCK_LOCK(so); 901 soopts = (so->so_options & SO_DONTROUTE); 902 SOCK_UNLOCK(so); | |
903 error = ip_output(m, tp->t_inpcb->inp_options, &tp->t_inpcb->inp_route, | 892 error = ip_output(m, tp->t_inpcb->inp_options, &tp->t_inpcb->inp_route, |
904 soopts, 0); | 893 (so->so_options & SO_DONTROUTE), 0); |
905 } 906 if (error) { 907 908 /* 909 * We know that the packet was lost, so back out the 910 * sequence number advance, if any. 911 */ 912 if (tp->t_force == 0 || !callout_active(tp->tt_persist)) { --- 81 unchanged lines hidden --- | 894 } 895 if (error) { 896 897 /* 898 * We know that the packet was lost, so back out the 899 * sequence number advance, if any. 900 */ 901 if (tp->t_force == 0 || !callout_active(tp->tt_persist)) { --- 81 unchanged lines hidden --- |