]> err.no Git - linux-2.6/blobdiff - net/dccp/ipv4.c
[IPV4]: Add 'rtable' field in struct sk_buff to alias 'dst' and avoid casts
[linux-2.6] / net / dccp / ipv4.c
index 514a40b7fc7fcbbf6e7be930d1be0d393b3ed489..17ad69e90e4890b982a56fb4afda11caeb6cbf21 100644 (file)
@@ -450,7 +450,7 @@ static struct dst_entry* dccp_v4_route_skb(struct sock *sk,
                                           struct sk_buff *skb)
 {
        struct rtable *rt;
-       struct flowi fl = { .oif = ((struct rtable *)skb->dst)->rt_iif,
+       struct flowi fl = { .oif = skb->rtable->rt_iif,
                            .nl_u = { .ip4_u =
                                      { .daddr = ip_hdr(skb)->saddr,
                                        .saddr = ip_hdr(skb)->daddr,
@@ -511,7 +511,7 @@ static void dccp_v4_ctl_send_reset(struct sock *sk, struct sk_buff *rxskb)
        if (dccp_hdr(rxskb)->dccph_type == DCCP_PKT_RESET)
                return;
 
-       if (((struct rtable *)rxskb->dst)->rt_type != RTN_LOCAL)
+       if (rxskb->rtable->rt_type != RTN_LOCAL)
                return;
 
        dst = dccp_v4_route_skb(dccp_v4_ctl_socket->sk, rxskb);
@@ -563,8 +563,7 @@ int dccp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
        struct dccp_skb_cb *dcb = DCCP_SKB_CB(skb);
 
        /* Never answer to DCCP_PKT_REQUESTs send to broadcast or multicast */
-       if (((struct rtable *)skb->dst)->rt_flags &
-           (RTCF_BROADCAST | RTCF_MULTICAST))
+       if (skb->rtable->rt_flags & (RTCF_BROADCAST | RTCF_MULTICAST))
                return 0;       /* discard, don't send a reset here */
 
        if (dccp_bad_service_code(sk, service)) {