diff options
Diffstat (limited to 'net/sched/sch_sfq.c')
-rw-r--r-- | net/sched/sch_sfq.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/net/sched/sch_sfq.c b/net/sched/sch_sfq.c index 66f32051a99b..96dfdf78d32c 100644 --- a/net/sched/sch_sfq.c +++ b/net/sched/sch_sfq.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/notifier.h> | 30 | #include <linux/notifier.h> |
31 | #include <linux/init.h> | 31 | #include <linux/init.h> |
32 | #include <net/ip.h> | 32 | #include <net/ip.h> |
33 | #include <net/netlink.h> | ||
33 | #include <linux/ipv6.h> | 34 | #include <linux/ipv6.h> |
34 | #include <net/route.h> | 35 | #include <net/route.h> |
35 | #include <linux/skbuff.h> | 36 | #include <linux/skbuff.h> |
@@ -137,7 +138,7 @@ static unsigned sfq_hash(struct sfq_sched_data *q, struct sk_buff *skb) | |||
137 | switch (skb->protocol) { | 138 | switch (skb->protocol) { |
138 | case __constant_htons(ETH_P_IP): | 139 | case __constant_htons(ETH_P_IP): |
139 | { | 140 | { |
140 | struct iphdr *iph = skb->nh.iph; | 141 | const struct iphdr *iph = ip_hdr(skb); |
141 | h = iph->daddr; | 142 | h = iph->daddr; |
142 | h2 = iph->saddr^iph->protocol; | 143 | h2 = iph->saddr^iph->protocol; |
143 | if (!(iph->frag_off&htons(IP_MF|IP_OFFSET)) && | 144 | if (!(iph->frag_off&htons(IP_MF|IP_OFFSET)) && |
@@ -152,7 +153,7 @@ static unsigned sfq_hash(struct sfq_sched_data *q, struct sk_buff *skb) | |||
152 | } | 153 | } |
153 | case __constant_htons(ETH_P_IPV6): | 154 | case __constant_htons(ETH_P_IPV6): |
154 | { | 155 | { |
155 | struct ipv6hdr *iph = skb->nh.ipv6h; | 156 | struct ipv6hdr *iph = ipv6_hdr(skb); |
156 | h = iph->daddr.s6_addr32[3]; | 157 | h = iph->daddr.s6_addr32[3]; |
157 | h2 = iph->saddr.s6_addr32[3]^iph->nexthdr; | 158 | h2 = iph->saddr.s6_addr32[3]^iph->nexthdr; |
158 | if (iph->nexthdr == IPPROTO_TCP || | 159 | if (iph->nexthdr == IPPROTO_TCP || |
@@ -461,7 +462,7 @@ static void sfq_destroy(struct Qdisc *sch) | |||
461 | static int sfq_dump(struct Qdisc *sch, struct sk_buff *skb) | 462 | static int sfq_dump(struct Qdisc *sch, struct sk_buff *skb) |
462 | { | 463 | { |
463 | struct sfq_sched_data *q = qdisc_priv(sch); | 464 | struct sfq_sched_data *q = qdisc_priv(sch); |
464 | unsigned char *b = skb->tail; | 465 | unsigned char *b = skb_tail_pointer(skb); |
465 | struct tc_sfq_qopt opt; | 466 | struct tc_sfq_qopt opt; |
466 | 467 | ||
467 | opt.quantum = q->quantum; | 468 | opt.quantum = q->quantum; |
@@ -476,7 +477,7 @@ static int sfq_dump(struct Qdisc *sch, struct sk_buff *skb) | |||
476 | return skb->len; | 477 | return skb->len; |
477 | 478 | ||
478 | rtattr_failure: | 479 | rtattr_failure: |
479 | skb_trim(skb, b - skb->data); | 480 | nlmsg_trim(skb, b); |
480 | return -1; | 481 | return -1; |
481 | } | 482 | } |
482 | 483 | ||