diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2009-06-02 01:14:27 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-06-03 05:51:02 -0400 |
commit | 511c3f92ad5b6d9f8f6464be1b4f85f0422be91a (patch) | |
tree | 3e368d9a78f87eb9dd7ff9e57f4aab3f4a96e3b1 /net/ipv4/ip_options.c | |
parent | dfbf97f3ac980b69dfbc41c83a208211a38443e8 (diff) |
net: skb->rtable accessor
Define skb_rtable(const struct sk_buff *skb) accessor to get rtable from skb
Delete skb->rtable field
Setting rtable is not allowed, just set dst instead as rtable is an alias.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ip_options.c')
-rw-r--r-- | net/ipv4/ip_options.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/net/ipv4/ip_options.c b/net/ipv4/ip_options.c index 2c88da6e7862..7e1074ffdbd1 100644 --- a/net/ipv4/ip_options.c +++ b/net/ipv4/ip_options.c | |||
@@ -102,7 +102,7 @@ int ip_options_echo(struct ip_options * dopt, struct sk_buff * skb) | |||
102 | sptr = skb_network_header(skb); | 102 | sptr = skb_network_header(skb); |
103 | dptr = dopt->__data; | 103 | dptr = dopt->__data; |
104 | 104 | ||
105 | daddr = skb->rtable->rt_spec_dst; | 105 | daddr = skb_rtable(skb)->rt_spec_dst; |
106 | 106 | ||
107 | if (sopt->rr) { | 107 | if (sopt->rr) { |
108 | optlen = sptr[sopt->rr+1]; | 108 | optlen = sptr[sopt->rr+1]; |
@@ -257,7 +257,7 @@ int ip_options_compile(struct net *net, | |||
257 | struct rtable *rt = NULL; | 257 | struct rtable *rt = NULL; |
258 | 258 | ||
259 | if (skb != NULL) { | 259 | if (skb != NULL) { |
260 | rt = skb->rtable; | 260 | rt = skb_rtable(skb); |
261 | optptr = (unsigned char *)&(ip_hdr(skb)[1]); | 261 | optptr = (unsigned char *)&(ip_hdr(skb)[1]); |
262 | } else | 262 | } else |
263 | optptr = opt->__data; | 263 | optptr = opt->__data; |
@@ -550,7 +550,7 @@ void ip_forward_options(struct sk_buff *skb) | |||
550 | { | 550 | { |
551 | struct ip_options * opt = &(IPCB(skb)->opt); | 551 | struct ip_options * opt = &(IPCB(skb)->opt); |
552 | unsigned char * optptr; | 552 | unsigned char * optptr; |
553 | struct rtable *rt = skb->rtable; | 553 | struct rtable *rt = skb_rtable(skb); |
554 | unsigned char *raw = skb_network_header(skb); | 554 | unsigned char *raw = skb_network_header(skb); |
555 | 555 | ||
556 | if (opt->rr_needaddr) { | 556 | if (opt->rr_needaddr) { |
@@ -598,7 +598,7 @@ int ip_options_rcv_srr(struct sk_buff *skb) | |||
598 | __be32 nexthop; | 598 | __be32 nexthop; |
599 | struct iphdr *iph = ip_hdr(skb); | 599 | struct iphdr *iph = ip_hdr(skb); |
600 | unsigned char *optptr = skb_network_header(skb) + opt->srr; | 600 | unsigned char *optptr = skb_network_header(skb) + opt->srr; |
601 | struct rtable *rt = skb->rtable; | 601 | struct rtable *rt = skb_rtable(skb); |
602 | struct rtable *rt2; | 602 | struct rtable *rt2; |
603 | int err; | 603 | int err; |
604 | 604 | ||
@@ -623,13 +623,13 @@ int ip_options_rcv_srr(struct sk_buff *skb) | |||
623 | } | 623 | } |
624 | memcpy(&nexthop, &optptr[srrptr-1], 4); | 624 | memcpy(&nexthop, &optptr[srrptr-1], 4); |
625 | 625 | ||
626 | rt = skb->rtable; | 626 | rt = skb_rtable(skb); |
627 | skb->rtable = NULL; | 627 | skb->dst = NULL; |
628 | err = ip_route_input(skb, nexthop, iph->saddr, iph->tos, skb->dev); | 628 | err = ip_route_input(skb, nexthop, iph->saddr, iph->tos, skb->dev); |
629 | rt2 = skb->rtable; | 629 | rt2 = skb_rtable(skb); |
630 | if (err || (rt2->rt_type != RTN_UNICAST && rt2->rt_type != RTN_LOCAL)) { | 630 | if (err || (rt2->rt_type != RTN_UNICAST && rt2->rt_type != RTN_LOCAL)) { |
631 | ip_rt_put(rt2); | 631 | ip_rt_put(rt2); |
632 | skb->rtable = rt; | 632 | skb->dst = &rt->u.dst; |
633 | return -EINVAL; | 633 | return -EINVAL; |
634 | } | 634 | } |
635 | ip_rt_put(rt); | 635 | ip_rt_put(rt); |