| @@ -445,12 +445,13 @@ struct tcp_out_options { · 444 unmodified lines |
| 445 | 445 | struct mptcp_out_options mptcp; |
| 446 | 446 | }; |
| 447 | 447 | |
| 448 | | −static void mptcp_options_write(__be32 *ptr, const struct tcp_sock *tp, |
| 448 | +static void mptcp_options_write(struct tcphdr *th, __be32 *ptr, |
| 449 | + struct tcp_sock *tp, |
| 449 | 450 | struct tcp_out_options *opts) |
| 450 | 451 | { |
| 451 | 452 | #if IS_ENABLED(CONFIG_MPTCP) |
| 452 | 453 | if (unlikely(OPTION_MPTCP & opts->options)) |
| 453 | | − mptcp_write_options(ptr, tp, &opts->mptcp); |
| 454 | + mptcp_write_options(th, ptr, tp, &opts->mptcp); |
| 454 | 455 | #endif |
| 455 | 456 | } |
| 456 | 457 | |
| @@ -606,9 +607,10 @@ static void bpf_skops_write_hdr_opt(struct sock *sk, struct sk_buff *skb, · 149 unmodified lines |
| 606 | 607 | * At least SACK_PERM as the first option is known to lead to a disaster |
| 607 | 608 | * (but it may well be that other scenarios fail similarly). |
| 608 | 609 | */ |
| 609 | | −static void tcp_options_write(__be32 *ptr, struct tcp_sock *tp, |
| 610 | +static void tcp_options_write(struct tcphdr *th, struct tcp_sock *tp, |
| 610 | 611 | struct tcp_out_options *opts) |
| 611 | 612 | { |
| 613 | + __be32 *ptr = (__be32 *)(th + 1); |
| 612 | 614 | u16 options = opts->options; /* mungable copy */ |
| 613 | 615 | |
| 614 | 616 | if (unlikely(OPTION_MD5 & options)) { |
| @@ -702,7 +704,7 @@ static void tcp_options_write(__be32 *ptr, struct tcp_sock *tp, · 87 unmodified lines |
| 702 | 704 | |
| 703 | 705 | smc_options_write(ptr, &options); |
| 704 | 706 | |
| 705 | | − mptcp_options_write(ptr, tp, opts); |
| 707 | + mptcp_options_write(th, ptr, tp, opts); |
| 706 | 708 | } |
| 707 | 709 | |
| 708 | 710 | static void smc_set_option(const struct tcp_sock *tp, |
| @@ -1355,7 +1357,7 @@ static int __tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, · 646 unmodified lines |
| 1355 | 1357 | th->window = htons(min(tp->rcv_wnd, 65535U)); |
| 1356 | 1358 | } |
| 1357 | 1359 | |
| 1358 | | − tcp_options_write((__be32 *)(th + 1), tp, &opts); |
| 1360 | + tcp_options_write(th, tp, &opts); |
| 1359 | 1361 | |
| 1360 | 1362 | #ifdef CONFIG_TCP_MD5SIG |
| 1361 | 1363 | /* Calculate the MD5 hash, as we have all we need now */ |
| @@ -3591,7 +3593,7 @@ struct sk_buff *tcp_make_synack(const struct sock *sk, struct dst_entry *dst, · 2229 unmodified lines |
| 3591 | 3593 | |
| 3592 | 3594 | /* RFC1323: The window in SYN & SYN/ACK segments is never scaled. */ |
| 3593 | 3595 | th->window = htons(min(req->rsk_rcv_wnd, 65535U)); |
| 3594 | | − tcp_options_write((__be32 *)(th + 1), NULL, &opts); |
| 3596 | + tcp_options_write(th, NULL, &opts); |
| 3595 | 3597 | th->doff = (tcp_header_size >> 2); |
| 3596 | 3598 | __TCP_INC_STATS(sock_net(sk), TCP_MIB_OUTSEGS); |
| 3597 | 3599 | |