diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2009-06-02 01:19:30 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-06-03 05:51:04 -0400 |
commit | adf30907d63893e4208dfe3f5c88ae12bc2f25d5 (patch) | |
tree | 0f07542bb95de2ad537540868aba6cf87a86e17d /net/ipv4/icmp.c | |
parent | 511c3f92ad5b6d9f8f6464be1b4f85f0422be91a (diff) |
net: skb->dst accessors
Define three accessors to get/set dst attached to a skb
struct dst_entry *skb_dst(const struct sk_buff *skb)
void skb_dst_set(struct sk_buff *skb, struct dst_entry *dst)
void skb_dst_drop(struct sk_buff *skb)
This one should replace occurrences of :
dst_release(skb->dst)
skb->dst = NULL;
Delete skb->dst field
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/icmp.c')
-rw-r--r-- | net/ipv4/icmp.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c index 94f75efae938..97c410e84388 100644 --- a/net/ipv4/icmp.c +++ b/net/ipv4/icmp.c | |||
@@ -591,13 +591,13 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info) | |||
591 | goto relookup_failed; | 591 | goto relookup_failed; |
592 | 592 | ||
593 | /* Ugh! */ | 593 | /* Ugh! */ |
594 | odst = skb_in->dst; | 594 | odst = skb_dst(skb_in); |
595 | err = ip_route_input(skb_in, fl.fl4_dst, fl.fl4_src, | 595 | err = ip_route_input(skb_in, fl.fl4_dst, fl.fl4_src, |
596 | RT_TOS(tos), rt2->u.dst.dev); | 596 | RT_TOS(tos), rt2->u.dst.dev); |
597 | 597 | ||
598 | dst_release(&rt2->u.dst); | 598 | dst_release(&rt2->u.dst); |
599 | rt2 = skb_rtable(skb_in); | 599 | rt2 = skb_rtable(skb_in); |
600 | skb_in->dst = odst; | 600 | skb_dst_set(skb_in, odst); |
601 | } | 601 | } |
602 | 602 | ||
603 | if (err) | 603 | if (err) |
@@ -659,7 +659,7 @@ static void icmp_unreach(struct sk_buff *skb) | |||
659 | u32 info = 0; | 659 | u32 info = 0; |
660 | struct net *net; | 660 | struct net *net; |
661 | 661 | ||
662 | net = dev_net(skb->dst->dev); | 662 | net = dev_net(skb_dst(skb)->dev); |
663 | 663 | ||
664 | /* | 664 | /* |
665 | * Incomplete header ? | 665 | * Incomplete header ? |
@@ -822,7 +822,7 @@ static void icmp_echo(struct sk_buff *skb) | |||
822 | { | 822 | { |
823 | struct net *net; | 823 | struct net *net; |
824 | 824 | ||
825 | net = dev_net(skb->dst->dev); | 825 | net = dev_net(skb_dst(skb)->dev); |
826 | if (!net->ipv4.sysctl_icmp_echo_ignore_all) { | 826 | if (!net->ipv4.sysctl_icmp_echo_ignore_all) { |
827 | struct icmp_bxm icmp_param; | 827 | struct icmp_bxm icmp_param; |
828 | 828 | ||
@@ -873,7 +873,7 @@ static void icmp_timestamp(struct sk_buff *skb) | |||
873 | out: | 873 | out: |
874 | return; | 874 | return; |
875 | out_err: | 875 | out_err: |
876 | ICMP_INC_STATS_BH(dev_net(skb->dst->dev), ICMP_MIB_INERRORS); | 876 | ICMP_INC_STATS_BH(dev_net(skb_dst(skb)->dev), ICMP_MIB_INERRORS); |
877 | goto out; | 877 | goto out; |
878 | } | 878 | } |
879 | 879 | ||