/net/netfilter/ |
D | nf_conntrack_seqadj.c | 76 struct tcphdr *tcph, in nf_ct_sack_block_adjust() argument 106 inet_proto_csum_replace4(&tcph->check, skb, in nf_ct_sack_block_adjust() 108 inet_proto_csum_replace4(&tcph->check, skb, in nf_ct_sack_block_adjust() 122 struct tcphdr *tcph = (void *)skb->data + protoff; in nf_ct_sack_adjust() local 127 optend = protoff + tcph->doff * 4; in nf_ct_sack_adjust() 132 tcph = (void *)skb->data + protoff; in nf_ct_sack_adjust() 154 nf_ct_sack_block_adjust(skb, tcph, optoff + 2, in nf_ct_sack_adjust() 169 struct tcphdr *tcph; in nf_ct_seq_adjust() local 179 if (skb_ensure_writable(skb, protoff + sizeof(*tcph))) in nf_ct_seq_adjust() 182 tcph = (void *)skb->data + protoff; in nf_ct_seq_adjust() [all …]
|
D | nft_exthdr.c | 163 struct tcphdr *tcph; in nft_tcp_header_pointer() local 168 tcph = skb_header_pointer(pkt->skb, pkt->xt.thoff, sizeof(*tcph), buffer); in nft_tcp_header_pointer() 169 if (!tcph) in nft_tcp_header_pointer() 172 *tcphdr_len = __tcp_hdrlen(tcph); in nft_tcp_header_pointer() 173 if (*tcphdr_len < sizeof(*tcph) || *tcphdr_len > len) in nft_tcp_header_pointer() 187 struct tcphdr *tcph; in nft_exthdr_tcp_eval() local 190 tcph = nft_tcp_header_pointer(pkt, sizeof(buff), buff, &tcphdr_len); in nft_exthdr_tcp_eval() 191 if (!tcph) in nft_exthdr_tcp_eval() 194 opt = (u8 *)tcph; in nft_exthdr_tcp_eval() 195 for (i = sizeof(*tcph); i < tcphdr_len - 1; i += optl) { in nft_exthdr_tcp_eval() [all …]
|
D | xt_TCPMSS.c | 78 struct tcphdr *tcph; in tcpmss_mangle_packet() local 96 tcph = (struct tcphdr *)(skb_network_header(skb) + tcphoff); in tcpmss_mangle_packet() 97 tcp_hdrlen = tcph->doff * 4; in tcpmss_mangle_packet() 116 opt = (u_int8_t *)tcph; in tcpmss_mangle_packet() 133 inet_proto_csum_replace2(&tcph->check, skb, in tcpmss_mangle_packet() 159 tcph = (struct tcphdr *)(skb_network_header(skb) + tcphoff); in tcpmss_mangle_packet() 176 opt = (u_int8_t *)tcph + sizeof(struct tcphdr); in tcpmss_mangle_packet() 179 inet_proto_csum_replace2(&tcph->check, skb, in tcpmss_mangle_packet() 186 inet_proto_csum_replace4(&tcph->check, skb, 0, *((__be32 *)opt), false); in tcpmss_mangle_packet() 188 oldval = ((__be16 *)tcph)[6]; in tcpmss_mangle_packet() [all …]
|
D | xt_TCPOPTSTRIP.c | 34 struct tcphdr *tcph, _th; in tcpoptstrip_mangle_packet() local 44 tcph = skb_header_pointer(skb, tcphoff, sizeof(_th), &_th); in tcpoptstrip_mangle_packet() 45 if (!tcph) in tcpoptstrip_mangle_packet() 48 tcp_hdrlen = tcph->doff * 4; in tcpoptstrip_mangle_packet() 56 tcph = (struct tcphdr *)(skb_network_header(skb) + tcphoff); in tcpoptstrip_mangle_packet() 57 opt = (u8 *)tcph; in tcpoptstrip_mangle_packet() 79 inet_proto_csum_replace2(&tcph->check, skb, htons(o), in tcpoptstrip_mangle_packet()
|
D | nf_flow_table_ip.c | 22 struct tcphdr *tcph; in nf_flow_state_check() local 27 if (!pskb_may_pull(skb, thoff + sizeof(*tcph))) in nf_flow_state_check() 30 tcph = (void *)(skb_network_header(skb) + thoff); in nf_flow_state_check() 31 if (unlikely(tcph->fin || tcph->rst)) { in nf_flow_state_check() 42 struct tcphdr *tcph; in nf_flow_nat_ip_tcp() local 44 if (!pskb_may_pull(skb, thoff + sizeof(*tcph)) || in nf_flow_nat_ip_tcp() 45 skb_try_make_writable(skb, thoff + sizeof(*tcph))) in nf_flow_nat_ip_tcp() 48 tcph = (void *)(skb_network_header(skb) + thoff); in nf_flow_nat_ip_tcp() 49 inet_proto_csum_replace4(&tcph->check, skb, addr, new_addr, true); in nf_flow_nat_ip_tcp() 308 struct tcphdr *tcph; in nf_flow_nat_ipv6_tcp() local [all …]
|
D | nf_conntrack_proto_tcp.c | 283 static unsigned int get_conntrack_index(const struct tcphdr *tcph) in get_conntrack_index() argument 285 if (tcph->rst) return TCP_RST_SET; in get_conntrack_index() 286 else if (tcph->syn) return (tcph->ack ? TCP_SYNACK_SET : TCP_SYN_SET); in get_conntrack_index() 287 else if (tcph->fin) return TCP_FIN_SET; in get_conntrack_index() 288 else if (tcph->ack) return TCP_ACK_SET; in get_conntrack_index() 324 const struct tcphdr *tcph) in segment_seq_plus_len() argument 328 return (seq + len - dataoff - tcph->doff*4 in segment_seq_plus_len() 329 + (tcph->syn ? 1 : 0) + (tcph->fin ? 1 : 0)); in segment_seq_plus_len() 343 const struct tcphdr *tcph, in tcp_options() argument 348 int length = (tcph->doff*4) - sizeof(struct tcphdr); in tcp_options() [all …]
|
D | nf_nat_helper.c | 95 struct tcphdr *tcph; in __nf_nat_mangle_tcp_packet() local 106 tcph = (void *)skb->data + protoff; in __nf_nat_mangle_tcp_packet() 109 mangle_contents(skb, protoff + tcph->doff*4, in __nf_nat_mangle_tcp_packet() 115 tcph, &tcph->check, datalen, oldlen); in __nf_nat_mangle_tcp_packet() 118 nf_ct_seqadj_set(ct, ctinfo, tcph->seq, in __nf_nat_mangle_tcp_packet()
|
D | nft_flow_offload.c | 76 struct tcphdr _tcph, *tcph = NULL; in nft_flow_offload_eval() local 93 tcph = skb_header_pointer(pkt->skb, pkt->xt.thoff, in nft_flow_offload_eval() 95 if (unlikely(!tcph || tcph->fin || tcph->rst)) in nft_flow_offload_eval() 122 if (tcph) { in nft_flow_offload_eval()
|
D | nf_flow_table_core.c | 350 struct tcphdr *tcph; in nf_flow_nat_port_tcp() local 352 if (!pskb_may_pull(skb, thoff + sizeof(*tcph)) || in nf_flow_nat_port_tcp() 353 skb_try_make_writable(skb, thoff + sizeof(*tcph))) in nf_flow_nat_port_tcp() 356 tcph = (void *)(skb_network_header(skb) + thoff); in nf_flow_nat_port_tcp() 357 inet_proto_csum_replace2(&tcph->check, skb, port, new_port, true); in nf_flow_nat_port_tcp()
|
D | nf_conntrack_pptp.c | 513 const struct tcphdr *tcph; in conntrack_pptp_help() local 538 tcph = skb_header_pointer(skb, nexthdr_off, sizeof(_tcph), &_tcph); in conntrack_pptp_help() 539 BUG_ON(!tcph); in conntrack_pptp_help() 540 nexthdr_off += tcph->doff * 4; in conntrack_pptp_help() 541 datalen = tcplen - tcph->doff * 4; in conntrack_pptp_help()
|
/net/ipv4/netfilter/ |
D | ipt_ECN.c | 47 struct tcphdr _tcph, *tcph; in set_ect_tcp() local 51 tcph = skb_header_pointer(skb, ip_hdrlen(skb), sizeof(_tcph), &_tcph); in set_ect_tcp() 52 if (!tcph) in set_ect_tcp() 56 tcph->ece == einfo->proto.tcp.ece) && in set_ect_tcp() 58 tcph->cwr == einfo->proto.tcp.cwr)) in set_ect_tcp() 61 if (skb_ensure_writable(skb, ip_hdrlen(skb) + sizeof(*tcph))) in set_ect_tcp() 63 tcph = (void *)ip_hdr(skb) + ip_hdrlen(skb); in set_ect_tcp() 65 oldval = ((__be16 *)tcph)[6]; in set_ect_tcp() 67 tcph->ece = einfo->proto.tcp.ece; in set_ect_tcp() 69 tcph->cwr = einfo->proto.tcp.cwr; in set_ect_tcp() [all …]
|
D | nf_reject_ipv4.c | 73 struct tcphdr *tcph; in nf_reject_ip_tcphdr_put() local 76 tcph = skb_put_zero(nskb, sizeof(struct tcphdr)); in nf_reject_ip_tcphdr_put() 77 tcph->source = oth->dest; in nf_reject_ip_tcphdr_put() 78 tcph->dest = oth->source; in nf_reject_ip_tcphdr_put() 79 tcph->doff = sizeof(struct tcphdr) / 4; in nf_reject_ip_tcphdr_put() 82 tcph->seq = oth->ack_seq; in nf_reject_ip_tcphdr_put() 84 tcph->ack_seq = htonl(ntohl(oth->seq) + oth->syn + oth->fin + in nf_reject_ip_tcphdr_put() 87 tcph->ack = 1; in nf_reject_ip_tcphdr_put() 90 tcph->rst = 1; in nf_reject_ip_tcphdr_put() 91 tcph->check = ~tcp_v4_check(sizeof(struct tcphdr), niph->saddr, in nf_reject_ip_tcphdr_put() [all …]
|
/net/ipv6/netfilter/ |
D | nf_reject_ipv6.c | 91 struct tcphdr *tcph; in nf_reject_ip6_tcphdr_put() local 95 tcph = skb_put(nskb, sizeof(struct tcphdr)); in nf_reject_ip6_tcphdr_put() 97 tcph->doff = sizeof(struct tcphdr)/4; in nf_reject_ip6_tcphdr_put() 98 tcph->source = oth->dest; in nf_reject_ip6_tcphdr_put() 99 tcph->dest = oth->source; in nf_reject_ip6_tcphdr_put() 103 tcph->seq = oth->ack_seq; in nf_reject_ip6_tcphdr_put() 104 tcph->ack_seq = 0; in nf_reject_ip6_tcphdr_put() 107 tcph->ack_seq = htonl(ntohl(oth->seq) + oth->syn + oth->fin + in nf_reject_ip6_tcphdr_put() 109 tcph->seq = 0; in nf_reject_ip6_tcphdr_put() 113 ((u_int8_t *)tcph)[13] = 0; in nf_reject_ip6_tcphdr_put() [all …]
|
/net/netfilter/ipvs/ |
D | ip_vs_proto_tcp.c | 105 tcp_fast_csum_update(int af, struct tcphdr *tcph, in tcp_fast_csum_update() argument 112 tcph->check = in tcp_fast_csum_update() 115 ~csum_unfold(tcph->check)))); in tcp_fast_csum_update() 118 tcph->check = in tcp_fast_csum_update() 121 ~csum_unfold(tcph->check)))); in tcp_fast_csum_update() 126 tcp_partial_csum_update(int af, struct tcphdr *tcph, in tcp_partial_csum_update() argument 133 tcph->check = in tcp_partial_csum_update() 136 csum_unfold(tcph->check)))); in tcp_partial_csum_update() 139 tcph->check = in tcp_partial_csum_update() 142 csum_unfold(tcph->check)))); in tcp_partial_csum_update() [all …]
|
/net/core/ |
D | tso.c | 19 struct tcphdr *tcph; in tso_build_hdr() local 35 tcph = (struct tcphdr *)(hdr + skb_transport_offset(skb)); in tso_build_hdr() 36 put_unaligned_be32(tso->tcp_seq, &tcph->seq); in tso_build_hdr() 40 tcph->psh = 0; in tso_build_hdr() 41 tcph->fin = 0; in tso_build_hdr() 42 tcph->rst = 0; in tso_build_hdr()
|
/net/sched/ |
D | act_csum.c | 210 struct tcphdr *tcph; in tcf_csum_ipv4_tcp() local 216 tcph = tcf_csum_skb_nextlayer(skb, ihl, ipl, sizeof(*tcph)); in tcf_csum_ipv4_tcp() 217 if (tcph == NULL) in tcf_csum_ipv4_tcp() 221 tcph->check = 0; in tcf_csum_ipv4_tcp() 222 skb->csum = csum_partial(tcph, ipl - ihl, 0); in tcf_csum_ipv4_tcp() 223 tcph->check = tcp_v4_check(ipl - ihl, in tcf_csum_ipv4_tcp() 234 struct tcphdr *tcph; in tcf_csum_ipv6_tcp() local 240 tcph = tcf_csum_skb_nextlayer(skb, ihl, ipl, sizeof(*tcph)); in tcf_csum_ipv6_tcp() 241 if (tcph == NULL) in tcf_csum_ipv6_tcp() 245 tcph->check = 0; in tcf_csum_ipv6_tcp() [all …]
|
D | act_nat.c | 172 struct tcphdr *tcph; in tcf_nat_act() local 174 if (!pskb_may_pull(skb, ihl + sizeof(*tcph) + noff) || in tcf_nat_act() 175 skb_try_make_writable(skb, ihl + sizeof(*tcph) + noff)) in tcf_nat_act() 178 tcph = (void *)(skb_network_header(skb) + ihl); in tcf_nat_act() 179 inet_proto_csum_replace4(&tcph->check, skb, addr, new_addr, in tcf_nat_act()
|
D | sch_cake.c | 870 const struct tcphdr *tcph; in cake_get_tcphdr() local 909 tcph = skb_header_pointer(skb, offset, sizeof(_tcph), &_tcph); in cake_get_tcphdr() 910 if (!tcph) in cake_get_tcphdr() 914 min(__tcp_hdrlen(tcph), bufsize), buf); in cake_get_tcphdr() 917 static const void *cake_get_tcpopt(const struct tcphdr *tcph, in cake_get_tcpopt() argument 921 int length = __tcp_hdrlen(tcph) - sizeof(struct tcphdr); in cake_get_tcpopt() 922 const u8 *ptr = (const u8 *)(tcph + 1); in cake_get_tcpopt() 1027 static void cake_tcph_get_tstamp(const struct tcphdr *tcph, in cake_tcph_get_tstamp() argument 1033 ptr = cake_get_tcpopt(tcph, TCPOPT_TIMESTAMP, &opsize); in cake_tcph_get_tstamp() 1041 static bool cake_tcph_may_drop(const struct tcphdr *tcph, in cake_tcph_may_drop() argument [all …]
|
/net/ipv4/ |
D | route.c | 2985 struct tcphdr *tcph; in inet_rtm_getroute_build_skb() local 2987 tcph = skb_put_zero(skb, sizeof(struct tcphdr)); in inet_rtm_getroute_build_skb() 2988 tcph->source = sport; in inet_rtm_getroute_build_skb() 2989 tcph->dest = dport; in inet_rtm_getroute_build_skb() 2990 tcph->doff = sizeof(struct tcphdr) / 4; in inet_rtm_getroute_build_skb() 2991 tcph->rst = 1; in inet_rtm_getroute_build_skb() 2992 tcph->check = ~tcp_v4_check(sizeof(struct tcphdr), in inet_rtm_getroute_build_skb()
|