aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_ipv4.c
diff options
context:
space:
mode:
authorEric Dumazet <dada1@cosmosbay.com>2008-03-05 21:30:47 -0500
committerDavid S. Miller <davem@davemloft.net>2008-03-05 21:30:47 -0500
commitee6b967301b4aa5d4a4b61e2f682f086266db9fb (patch)
tree197c2430f87733dc80d00d1971f1be2a0e562358 /net/ipv4/tcp_ipv4.c
parenta05c44f6d5fb6cd29da04f96bf5ffaa05f545ac5 (diff)
[IPV4]: Add 'rtable' field in struct sk_buff to alias 'dst' and avoid casts
(Anonymous) unions can help us to avoid ugly casts. A common cast it the (struct rtable *)skb->dst one. Defining an union like : union { struct dst_entry *dst; struct rtable *rtable; }; permits to use skb->rtable in place. Signed-off-by: Eric Dumazet <dada1@cosmosbay.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_ipv4.c')
-rw-r--r--net/ipv4/tcp_ipv4.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 3873c4dbeae..a79e324638e 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -552,7 +552,7 @@ static void tcp_v4_send_reset(struct sock *sk, struct sk_buff *skb)
552 if (th->rst) 552 if (th->rst)
553 return; 553 return;
554 554
555 if (((struct rtable *)skb->dst)->rt_type != RTN_LOCAL) 555 if (skb->rtable->rt_type != RTN_LOCAL)
556 return; 556 return;
557 557
558 /* Swap the send and the receive. */ 558 /* Swap the send and the receive. */
@@ -1262,8 +1262,7 @@ int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
1262#endif 1262#endif
1263 1263
1264 /* Never answer to SYNs send to broadcast or multicast */ 1264 /* Never answer to SYNs send to broadcast or multicast */
1265 if (((struct rtable *)skb->dst)->rt_flags & 1265 if (skb->rtable->rt_flags & (RTCF_BROADCAST | RTCF_MULTICAST))
1266 (RTCF_BROADCAST | RTCF_MULTICAST))
1267 goto drop; 1266 goto drop;
1268 1267
1269 /* TW buckets are converted to open requests without 1268 /* TW buckets are converted to open requests without