ip_output.c (aa9e0de81b5b257f6dae48efe2ed5f255f066497) | ip_output.c (09c2d251b70723650ba47e83571ff49281320f7c) |
---|---|
1/* 2 * INET An implementation of the TCP/IP protocol suite for the LINUX 3 * operating system. INET is implemented using the BSD Socket 4 * interface as the means of communication with the user level. 5 * 6 * The Internet Protocol (IP) output module. 7 * 8 * Authors: Ross Biro --- 841 unchanged lines hidden (view full) --- 850 int exthdrlen; 851 int mtu; 852 int copy; 853 int err; 854 int offset = 0; 855 unsigned int maxfraglen, fragheaderlen, maxnonfragsize; 856 int csummode = CHECKSUM_NONE; 857 struct rtable *rt = (struct rtable *)cork->dst; | 1/* 2 * INET An implementation of the TCP/IP protocol suite for the LINUX 3 * operating system. INET is implemented using the BSD Socket 4 * interface as the means of communication with the user level. 5 * 6 * The Internet Protocol (IP) output module. 7 * 8 * Authors: Ross Biro --- 841 unchanged lines hidden (view full) --- 850 int exthdrlen; 851 int mtu; 852 int copy; 853 int err; 854 int offset = 0; 855 unsigned int maxfraglen, fragheaderlen, maxnonfragsize; 856 int csummode = CHECKSUM_NONE; 857 struct rtable *rt = (struct rtable *)cork->dst; |
858 u32 tskey = 0; |
|
858 859 skb = skb_peek_tail(queue); 860 861 exthdrlen = !skb ? rt->dst.header_len : 0; 862 mtu = cork->fragsize; | 859 860 skb = skb_peek_tail(queue); 861 862 exthdrlen = !skb ? rt->dst.header_len : 0; 863 mtu = cork->fragsize; |
864 if (cork->tx_flags & SKBTX_ANY_SW_TSTAMP && 865 sk->sk_tsflags & SOF_TIMESTAMPING_OPT_ID) 866 tskey = sk->sk_tskey++; |
|
863 864 hh_len = LL_RESERVED_SPACE(rt->dst.dev); 865 866 fragheaderlen = sizeof(struct iphdr) + (opt ? opt->optlen : 0); 867 maxfraglen = ((mtu - fragheaderlen) & ~7) + fragheaderlen; 868 maxnonfragsize = ip_sk_ignore_df(sk) ? 0xFFFF : mtu; 869 870 if (cork->length + length > maxnonfragsize - fragheaderlen) { --- 86 unchanged lines hidden (view full) --- 957 skb = NULL; 958 if (atomic_read(&sk->sk_wmem_alloc) <= 959 2 * sk->sk_sndbuf) 960 skb = sock_wmalloc(sk, 961 alloclen + hh_len + 15, 1, 962 sk->sk_allocation); 963 if (unlikely(skb == NULL)) 964 err = -ENOBUFS; | 867 868 hh_len = LL_RESERVED_SPACE(rt->dst.dev); 869 870 fragheaderlen = sizeof(struct iphdr) + (opt ? opt->optlen : 0); 871 maxfraglen = ((mtu - fragheaderlen) & ~7) + fragheaderlen; 872 maxnonfragsize = ip_sk_ignore_df(sk) ? 0xFFFF : mtu; 873 874 if (cork->length + length > maxnonfragsize - fragheaderlen) { --- 86 unchanged lines hidden (view full) --- 961 skb = NULL; 962 if (atomic_read(&sk->sk_wmem_alloc) <= 963 2 * sk->sk_sndbuf) 964 skb = sock_wmalloc(sk, 965 alloclen + hh_len + 15, 1, 966 sk->sk_allocation); 967 if (unlikely(skb == NULL)) 968 err = -ENOBUFS; |
965 else 966 /* only the initial fragment is 967 time stamped */ 968 cork->tx_flags = 0; | |
969 } 970 if (skb == NULL) 971 goto error; 972 973 /* 974 * Fill in the control structures 975 */ 976 skb->ip_summed = csummode; 977 skb->csum = 0; 978 skb_reserve(skb, hh_len); | 969 } 970 if (skb == NULL) 971 goto error; 972 973 /* 974 * Fill in the control structures 975 */ 976 skb->ip_summed = csummode; 977 skb->csum = 0; 978 skb_reserve(skb, hh_len); |
979 980 /* only the initial fragment is time stamped */ |
|
979 skb_shinfo(skb)->tx_flags = cork->tx_flags; | 981 skb_shinfo(skb)->tx_flags = cork->tx_flags; |
982 cork->tx_flags = 0; 983 skb_shinfo(skb)->tskey = tskey; 984 tskey = 0; |
|
980 981 /* 982 * Find where to start putting bytes. 983 */ 984 data = skb_put(skb, fraglen + exthdrlen); 985 skb_set_network_header(skb, exthdrlen); 986 skb->transport_header = (skb->network_header + 987 fragheaderlen); --- 610 unchanged lines hidden --- | 985 986 /* 987 * Find where to start putting bytes. 988 */ 989 data = skb_put(skb, fraglen + exthdrlen); 990 skb_set_network_header(skb, exthdrlen); 991 skb->transport_header = (skb->network_header + 992 fragheaderlen); --- 610 unchanged lines hidden --- |