Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fd80eb94 authored by Denis V. Lunev's avatar Denis V. Lunev Committed by David S. Miller
Browse files

[INET]: Remove struct dst_entry *dst from request_sock_ops.rtx_syn_ack.



It looks like dst parameter is used in this API due to historical
reasons.  Actually, it is really used in the direct call to
tcp_v4_send_synack only.  So, create a wrapper for tcp_v4_send_synack
and remove dst from rtx_syn_ack.

Signed-off-by: default avatarDenis V. Lunev <den@openvz.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 58fbbed4
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -31,8 +31,7 @@ struct request_sock_ops {
	int		obj_size;
	struct kmem_cache	*slab;
	int		(*rtx_syn_ack)(struct sock *sk,
				       struct request_sock *req,
				       struct dst_entry *dst);
				       struct request_sock *req);
	void		(*send_ack)(struct sk_buff *skb,
				    struct request_sock *req);
	void		(*send_reset)(struct sock *sk,
+5 −6
Original line number Diff line number Diff line
@@ -471,15 +471,14 @@ static struct dst_entry* dccp_v4_route_skb(struct sock *sk,
	return &rt->u.dst;
}

static int dccp_v4_send_response(struct sock *sk, struct request_sock *req,
				 struct dst_entry *dst)
static int dccp_v4_send_response(struct sock *sk, struct request_sock *req)
{
	int err = -1;
	struct sk_buff *skb;
	struct dst_entry *dst;

	/* First, grab a route. */

	if (dst == NULL && (dst = inet_csk_route_req(sk, req)) == NULL)
	dst = inet_csk_route_req(sk, req);
	if (dst == NULL)
		goto out;

	skb = dccp_make_response(sk, dst, req);
@@ -620,7 +619,7 @@ int dccp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
	dreq->dreq_iss	   = dccp_v4_init_sequence(skb);
	dreq->dreq_service = service;

	if (dccp_v4_send_response(sk, req, NULL))
	if (dccp_v4_send_response(sk, req))
		goto drop_and_free;

	inet_csk_reqsk_queue_hash_add(sk, req, DCCP_TIMEOUT_INIT);
+18 −20
Original line number Diff line number Diff line
@@ -224,8 +224,7 @@ static void dccp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
}


static int dccp_v6_send_response(struct sock *sk, struct request_sock *req,
				 struct dst_entry *dst)
static int dccp_v6_send_response(struct sock *sk, struct request_sock *req)
{
	struct inet6_request_sock *ireq6 = inet6_rsk(req);
	struct ipv6_pinfo *np = inet6_sk(sk);
@@ -234,6 +233,7 @@ static int dccp_v6_send_response(struct sock *sk, struct request_sock *req,
	struct in6_addr *final_p = NULL, final;
	struct flowi fl;
	int err = -1;
	struct dst_entry *dst;

	memset(&fl, 0, sizeof(fl));
	fl.proto = IPPROTO_DCCP;
@@ -245,7 +245,6 @@ static int dccp_v6_send_response(struct sock *sk, struct request_sock *req,
	fl.fl_ip_sport = inet_sk(sk)->sport;
	security_req_classify_flow(req, &fl);

	if (dst == NULL) {
	opt = np->opt;

	if (opt != NULL && opt->srcrt != NULL) {
@@ -266,7 +265,6 @@ static int dccp_v6_send_response(struct sock *sk, struct request_sock *req,
	err = xfrm_lookup(&dst, &fl, sk, 0);
	if (err < 0)
		goto done;
	}

	skb = dccp_make_response(sk, dst, req);
	if (skb != NULL) {
@@ -448,7 +446,7 @@ static int dccp_v6_conn_request(struct sock *sk, struct sk_buff *skb)
	dreq->dreq_iss	   = dccp_v6_init_sequence(skb);
	dreq->dreq_service = service;

	if (dccp_v6_send_response(sk, req, NULL))
	if (dccp_v6_send_response(sk, req))
		goto drop_and_free;

	inet6_csk_reqsk_queue_hash_add(sk, req, DCCP_TIMEOUT_INIT);
+1 −1
Original line number Diff line number Diff line
@@ -216,7 +216,7 @@ struct sock *dccp_check_req(struct sock *sk, struct sk_buff *skb,
			 * counter (backoff, monitored by dccp_response_timer).
			 */
			req->retrans++;
			req->rsk_ops->rtx_syn_ack(sk, req, NULL);
			req->rsk_ops->rtx_syn_ack(sk, req);
		}
		/* Network Duplicate, discard packet */
		return NULL;
+1 −1
Original line number Diff line number Diff line
@@ -463,7 +463,7 @@ void inet_csk_reqsk_queue_prune(struct sock *parent,
			if (time_after_eq(now, req->expires)) {
				if ((req->retrans < thresh ||
				     (inet_rsk(req)->acked && req->retrans < max_retries))
				    && !req->rsk_ops->rtx_syn_ack(parent, req, NULL)) {
				    && !req->rsk_ops->rtx_syn_ack(parent, req)) {
					unsigned long timeo;

					if (req->retrans++ == 0)
Loading