aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/ipmr.c
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2009-06-02 01:19:30 -0400
committerDavid S. Miller <davem@davemloft.net>2009-06-03 05:51:04 -0400
commitadf30907d63893e4208dfe3f5c88ae12bc2f25d5 (patch)
tree0f07542bb95de2ad537540868aba6cf87a86e17d /net/ipv4/ipmr.c
parent511c3f92ad5b6d9f8f6464be1b4f85f0422be91a (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/ipmr.c')
-rw-r--r--net/ipv4/ipmr.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index 69dd058283eb..ffd986104468 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -651,7 +651,7 @@ static int ipmr_cache_report(struct net *net,
651 ip_hdr(skb)->protocol = 0; /* Flag to the kernel this is a route add */ 651 ip_hdr(skb)->protocol = 0; /* Flag to the kernel this is a route add */
652 msg = (struct igmpmsg *)skb_network_header(skb); 652 msg = (struct igmpmsg *)skb_network_header(skb);
653 msg->im_vif = vifi; 653 msg->im_vif = vifi;
654 skb->dst = dst_clone(pkt->dst); 654 skb_dst_set(skb, dst_clone(skb_dst(pkt)));
655 655
656 /* 656 /*
657 * Add our header 657 * Add our header
@@ -1201,7 +1201,7 @@ static void ip_encap(struct sk_buff *skb, __be32 saddr, __be32 daddr)
1201 iph->protocol = IPPROTO_IPIP; 1201 iph->protocol = IPPROTO_IPIP;
1202 iph->ihl = 5; 1202 iph->ihl = 5;
1203 iph->tot_len = htons(skb->len); 1203 iph->tot_len = htons(skb->len);
1204 ip_select_ident(iph, skb->dst, NULL); 1204 ip_select_ident(iph, skb_dst(skb), NULL);
1205 ip_send_check(iph); 1205 ip_send_check(iph);
1206 1206
1207 memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt)); 1207 memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt));
@@ -1212,7 +1212,7 @@ static inline int ipmr_forward_finish(struct sk_buff *skb)
1212{ 1212{
1213 struct ip_options * opt = &(IPCB(skb)->opt); 1213 struct ip_options * opt = &(IPCB(skb)->opt);
1214 1214
1215 IP_INC_STATS_BH(dev_net(skb->dst->dev), IPSTATS_MIB_OUTFORWDATAGRAMS); 1215 IP_INC_STATS_BH(dev_net(skb_dst(skb)->dev), IPSTATS_MIB_OUTFORWDATAGRAMS);
1216 1216
1217 if (unlikely(opt->optlen)) 1217 if (unlikely(opt->optlen))
1218 ip_forward_options(skb); 1218 ip_forward_options(skb);
@@ -1290,8 +1290,8 @@ static void ipmr_queue_xmit(struct sk_buff *skb, struct mfc_cache *c, int vifi)
1290 vif->pkt_out++; 1290 vif->pkt_out++;
1291 vif->bytes_out += skb->len; 1291 vif->bytes_out += skb->len;
1292 1292
1293 dst_release(skb->dst); 1293 skb_dst_drop(skb);
1294 skb->dst = &rt->u.dst; 1294 skb_dst_set(skb, &rt->u.dst);
1295 ip_decrease_ttl(ip_hdr(skb)); 1295 ip_decrease_ttl(ip_hdr(skb));
1296 1296
1297 /* FIXME: forward and output firewalls used to be called here. 1297 /* FIXME: forward and output firewalls used to be called here.
@@ -1543,8 +1543,7 @@ static int __pim_rcv(struct sk_buff *skb, unsigned int pimlen)
1543 skb->protocol = htons(ETH_P_IP); 1543 skb->protocol = htons(ETH_P_IP);
1544 skb->ip_summed = 0; 1544 skb->ip_summed = 0;
1545 skb->pkt_type = PACKET_HOST; 1545 skb->pkt_type = PACKET_HOST;
1546 dst_release(skb->dst); 1546 skb_dst_drop(skb);
1547 skb->dst = NULL;
1548 reg_dev->stats.rx_bytes += skb->len; 1547 reg_dev->stats.rx_bytes += skb->len;
1549 reg_dev->stats.rx_packets++; 1548 reg_dev->stats.rx_packets++;
1550 nf_reset(skb); 1549 nf_reset(skb);