diff options
author | Eric Dumazet <dada1@cosmosbay.com> | 2008-03-05 21:30:47 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-03-05 21:30:47 -0500 |
commit | ee6b967301b4aa5d4a4b61e2f682f086266db9fb (patch) | |
tree | 197c2430f87733dc80d00d1971f1be2a0e562358 /net/sctp/protocol.c | |
parent | a05c44f6d5fb6cd29da04f96bf5ffaa05f545ac5 (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/sctp/protocol.c')
-rw-r--r-- | net/sctp/protocol.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c index 8d9d929f6cea..1afef08f6c1d 100644 --- a/net/sctp/protocol.c +++ b/net/sctp/protocol.c | |||
@@ -363,7 +363,7 @@ static int sctp_v4_addr_valid(union sctp_addr *addr, | |||
363 | return 0; | 363 | return 0; |
364 | 364 | ||
365 | /* Is this a broadcast address? */ | 365 | /* Is this a broadcast address? */ |
366 | if (skb && ((struct rtable *)skb->dst)->rt_flags & RTCF_BROADCAST) | 366 | if (skb && skb->rtable->rt_flags & RTCF_BROADCAST) |
367 | return 0; | 367 | return 0; |
368 | 368 | ||
369 | return 1; | 369 | return 1; |
@@ -539,7 +539,7 @@ static void sctp_v4_get_saddr(struct sctp_association *asoc, | |||
539 | /* What interface did this skb arrive on? */ | 539 | /* What interface did this skb arrive on? */ |
540 | static int sctp_v4_skb_iif(const struct sk_buff *skb) | 540 | static int sctp_v4_skb_iif(const struct sk_buff *skb) |
541 | { | 541 | { |
542 | return ((struct rtable *)skb->dst)->rt_iif; | 542 | return skb->rtable->rt_iif; |
543 | } | 543 | } |
544 | 544 | ||
545 | /* Was this packet marked by Explicit Congestion Notification? */ | 545 | /* Was this packet marked by Explicit Congestion Notification? */ |
@@ -828,8 +828,8 @@ static inline int sctp_v4_xmit(struct sk_buff *skb, | |||
828 | SCTP_DEBUG_PRINTK("%s: skb:%p, len:%d, " | 828 | SCTP_DEBUG_PRINTK("%s: skb:%p, len:%d, " |
829 | "src:%u.%u.%u.%u, dst:%u.%u.%u.%u\n", | 829 | "src:%u.%u.%u.%u, dst:%u.%u.%u.%u\n", |
830 | __FUNCTION__, skb, skb->len, | 830 | __FUNCTION__, skb, skb->len, |
831 | NIPQUAD(((struct rtable *)skb->dst)->rt_src), | 831 | NIPQUAD(skb->rtable->rt_src), |
832 | NIPQUAD(((struct rtable *)skb->dst)->rt_dst)); | 832 | NIPQUAD(skb->rtable->rt_dst)); |
833 | 833 | ||
834 | SCTP_INC_STATS(SCTP_MIB_OUTSCTPPACKS); | 834 | SCTP_INC_STATS(SCTP_MIB_OUTSCTPPACKS); |
835 | return ip_queue_xmit(skb, ipfragok); | 835 | return ip_queue_xmit(skb, ipfragok); |