diff options
Diffstat (limited to 'net/dccp/ipv4.c')
-rw-r--r-- | net/dccp/ipv4.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c index 474075adbde4..17ad69e90e48 100644 --- a/net/dccp/ipv4.c +++ b/net/dccp/ipv4.c | |||
@@ -450,7 +450,7 @@ static struct dst_entry* dccp_v4_route_skb(struct sock *sk, | |||
450 | struct sk_buff *skb) | 450 | struct sk_buff *skb) |
451 | { | 451 | { |
452 | struct rtable *rt; | 452 | struct rtable *rt; |
453 | struct flowi fl = { .oif = ((struct rtable *)skb->dst)->rt_iif, | 453 | struct flowi fl = { .oif = skb->rtable->rt_iif, |
454 | .nl_u = { .ip4_u = | 454 | .nl_u = { .ip4_u = |
455 | { .daddr = ip_hdr(skb)->saddr, | 455 | { .daddr = ip_hdr(skb)->saddr, |
456 | .saddr = ip_hdr(skb)->daddr, | 456 | .saddr = ip_hdr(skb)->daddr, |
@@ -471,15 +471,14 @@ static struct dst_entry* dccp_v4_route_skb(struct sock *sk, | |||
471 | return &rt->u.dst; | 471 | return &rt->u.dst; |
472 | } | 472 | } |
473 | 473 | ||
474 | static int dccp_v4_send_response(struct sock *sk, struct request_sock *req, | 474 | static int dccp_v4_send_response(struct sock *sk, struct request_sock *req) |
475 | struct dst_entry *dst) | ||
476 | { | 475 | { |
477 | int err = -1; | 476 | int err = -1; |
478 | struct sk_buff *skb; | 477 | struct sk_buff *skb; |
478 | struct dst_entry *dst; | ||
479 | 479 | ||
480 | /* First, grab a route. */ | 480 | dst = inet_csk_route_req(sk, req); |
481 | 481 | if (dst == NULL) | |
482 | if (dst == NULL && (dst = inet_csk_route_req(sk, req)) == NULL) | ||
483 | goto out; | 482 | goto out; |
484 | 483 | ||
485 | skb = dccp_make_response(sk, dst, req); | 484 | skb = dccp_make_response(sk, dst, req); |
@@ -512,7 +511,7 @@ static void dccp_v4_ctl_send_reset(struct sock *sk, struct sk_buff *rxskb) | |||
512 | if (dccp_hdr(rxskb)->dccph_type == DCCP_PKT_RESET) | 511 | if (dccp_hdr(rxskb)->dccph_type == DCCP_PKT_RESET) |
513 | return; | 512 | return; |
514 | 513 | ||
515 | if (((struct rtable *)rxskb->dst)->rt_type != RTN_LOCAL) | 514 | if (rxskb->rtable->rt_type != RTN_LOCAL) |
516 | return; | 515 | return; |
517 | 516 | ||
518 | dst = dccp_v4_route_skb(dccp_v4_ctl_socket->sk, rxskb); | 517 | dst = dccp_v4_route_skb(dccp_v4_ctl_socket->sk, rxskb); |
@@ -564,8 +563,7 @@ int dccp_v4_conn_request(struct sock *sk, struct sk_buff *skb) | |||
564 | struct dccp_skb_cb *dcb = DCCP_SKB_CB(skb); | 563 | struct dccp_skb_cb *dcb = DCCP_SKB_CB(skb); |
565 | 564 | ||
566 | /* Never answer to DCCP_PKT_REQUESTs send to broadcast or multicast */ | 565 | /* Never answer to DCCP_PKT_REQUESTs send to broadcast or multicast */ |
567 | if (((struct rtable *)skb->dst)->rt_flags & | 566 | if (skb->rtable->rt_flags & (RTCF_BROADCAST | RTCF_MULTICAST)) |
568 | (RTCF_BROADCAST | RTCF_MULTICAST)) | ||
569 | return 0; /* discard, don't send a reset here */ | 567 | return 0; /* discard, don't send a reset here */ |
570 | 568 | ||
571 | if (dccp_bad_service_code(sk, service)) { | 569 | if (dccp_bad_service_code(sk, service)) { |
@@ -620,7 +618,7 @@ int dccp_v4_conn_request(struct sock *sk, struct sk_buff *skb) | |||
620 | dreq->dreq_iss = dccp_v4_init_sequence(skb); | 618 | dreq->dreq_iss = dccp_v4_init_sequence(skb); |
621 | dreq->dreq_service = service; | 619 | dreq->dreq_service = service; |
622 | 620 | ||
623 | if (dccp_v4_send_response(sk, req, NULL)) | 621 | if (dccp_v4_send_response(sk, req)) |
624 | goto drop_and_free; | 622 | goto drop_and_free; |
625 | 623 | ||
626 | inet_csk_reqsk_queue_hash_add(sk, req, DCCP_TIMEOUT_INIT); | 624 | inet_csk_reqsk_queue_hash_add(sk, req, DCCP_TIMEOUT_INIT); |