diff options
-rw-r--r-- | include/net/request_sock.h | 5 | ||||
-rw-r--r-- | net/dccp/ipv4.c | 4 | ||||
-rw-r--r-- | net/ipv4/inet_diag.c | 4 | ||||
-rw-r--r-- | net/ipv4/syncookies.c | 4 | ||||
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 8 |
5 files changed, 15 insertions, 10 deletions
diff --git a/include/net/request_sock.h b/include/net/request_sock.h index 3fa4f824900a..e7ef86340514 100644 --- a/include/net/request_sock.h +++ b/include/net/request_sock.h | |||
@@ -91,6 +91,11 @@ static inline struct request_sock *inet_reqsk(struct sock *sk) | |||
91 | return (struct request_sock *)sk; | 91 | return (struct request_sock *)sk; |
92 | } | 92 | } |
93 | 93 | ||
94 | static inline struct sock *req_to_sk(struct request_sock *req) | ||
95 | { | ||
96 | return (struct sock *)req; | ||
97 | } | ||
98 | |||
94 | static inline void reqsk_free(struct request_sock *req) | 99 | static inline void reqsk_free(struct request_sock *req) |
95 | { | 100 | { |
96 | /* temporary debugging */ | 101 | /* temporary debugging */ |
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c index f3f8906f482e..e7ad291cd96b 100644 --- a/net/dccp/ipv4.c +++ b/net/dccp/ipv4.c | |||
@@ -638,8 +638,8 @@ int dccp_v4_conn_request(struct sock *sk, struct sk_buff *skb) | |||
638 | goto drop_and_free; | 638 | goto drop_and_free; |
639 | 639 | ||
640 | ireq = inet_rsk(req); | 640 | ireq = inet_rsk(req); |
641 | ireq->ir_loc_addr = ip_hdr(skb)->daddr; | 641 | sk_rcv_saddr_set(req_to_sk(req), ip_hdr(skb)->daddr); |
642 | ireq->ir_rmt_addr = ip_hdr(skb)->saddr; | 642 | sk_daddr_set(req_to_sk(req), ip_hdr(skb)->saddr); |
643 | ireq->ireq_family = AF_INET; | 643 | ireq->ireq_family = AF_INET; |
644 | ireq->ir_iif = sk->sk_bound_dev_if; | 644 | ireq->ir_iif = sk->sk_bound_dev_if; |
645 | 645 | ||
diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c index e7ba59038c8d..74c39c9f3e11 100644 --- a/net/ipv4/inet_diag.c +++ b/net/ipv4/inet_diag.c | |||
@@ -742,14 +742,14 @@ static int inet_diag_dump_reqs(struct sk_buff *skb, struct sock *sk, | |||
742 | 742 | ||
743 | if (bc) { | 743 | if (bc) { |
744 | /* Note: entry.sport and entry.userlocks are already set */ | 744 | /* Note: entry.sport and entry.userlocks are already set */ |
745 | entry_fill_addrs(&entry, (struct sock *)req); | 745 | entry_fill_addrs(&entry, req_to_sk(req)); |
746 | entry.dport = ntohs(ireq->ir_rmt_port); | 746 | entry.dport = ntohs(ireq->ir_rmt_port); |
747 | 747 | ||
748 | if (!inet_diag_bc_run(bc, &entry)) | 748 | if (!inet_diag_bc_run(bc, &entry)) |
749 | continue; | 749 | continue; |
750 | } | 750 | } |
751 | 751 | ||
752 | err = inet_req_diag_fill((struct sock *)req, skb, | 752 | err = inet_req_diag_fill(req_to_sk(req), skb, |
753 | NETLINK_CB(cb->skb).portid, | 753 | NETLINK_CB(cb->skb).portid, |
754 | cb->nlh->nlmsg_seq, | 754 | cb->nlh->nlmsg_seq, |
755 | NLM_F_MULTI, cb->nlh); | 755 | NLM_F_MULTI, cb->nlh); |
diff --git a/net/ipv4/syncookies.c b/net/ipv4/syncookies.c index 34e755403715..ef01d8570358 100644 --- a/net/ipv4/syncookies.c +++ b/net/ipv4/syncookies.c | |||
@@ -337,8 +337,8 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb) | |||
337 | req->mss = mss; | 337 | req->mss = mss; |
338 | ireq->ir_num = ntohs(th->dest); | 338 | ireq->ir_num = ntohs(th->dest); |
339 | ireq->ir_rmt_port = th->source; | 339 | ireq->ir_rmt_port = th->source; |
340 | ireq->ir_loc_addr = ip_hdr(skb)->daddr; | 340 | sk_rcv_saddr_set(req_to_sk(req), ip_hdr(skb)->daddr); |
341 | ireq->ir_rmt_addr = ip_hdr(skb)->saddr; | 341 | sk_daddr_set(req_to_sk(req), ip_hdr(skb)->saddr); |
342 | ireq->ir_mark = inet_request_mark(sk, skb); | 342 | ireq->ir_mark = inet_request_mark(sk, skb); |
343 | ireq->snd_wscale = tcp_opt.snd_wscale; | 343 | ireq->snd_wscale = tcp_opt.snd_wscale; |
344 | ireq->sack_ok = tcp_opt.sack_ok; | 344 | ireq->sack_ok = tcp_opt.sack_ok; |
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index ca207df4af1c..ddd0b1f25b96 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -1219,14 +1219,14 @@ static bool tcp_v4_inbound_md5_hash(struct sock *sk, const struct sk_buff *skb) | |||
1219 | 1219 | ||
1220 | #endif | 1220 | #endif |
1221 | 1221 | ||
1222 | static void tcp_v4_init_req(struct request_sock *req, struct sock *sk, | 1222 | static void tcp_v4_init_req(struct request_sock *req, struct sock *sk_listener, |
1223 | struct sk_buff *skb) | 1223 | struct sk_buff *skb) |
1224 | { | 1224 | { |
1225 | struct inet_request_sock *ireq = inet_rsk(req); | 1225 | struct inet_request_sock *ireq = inet_rsk(req); |
1226 | 1226 | ||
1227 | ireq->ir_loc_addr = ip_hdr(skb)->daddr; | 1227 | sk_rcv_saddr_set(req_to_sk(req), ip_hdr(skb)->daddr); |
1228 | ireq->ir_rmt_addr = ip_hdr(skb)->saddr; | 1228 | sk_daddr_set(req_to_sk(req), ip_hdr(skb)->saddr); |
1229 | ireq->no_srccheck = inet_sk(sk)->transparent; | 1229 | ireq->no_srccheck = inet_sk(sk_listener)->transparent; |
1230 | ireq->opt = tcp_v4_save_options(skb); | 1230 | ireq->opt = tcp_v4_save_options(skb); |
1231 | ireq->ireq_family = AF_INET; | 1231 | ireq->ireq_family = AF_INET; |
1232 | } | 1232 | } |