aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/sch_atm.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sched/sch_atm.c')
-rw-r--r--net/sched/sch_atm.c28
1 files changed, 8 insertions, 20 deletions
diff --git a/net/sched/sch_atm.c b/net/sched/sch_atm.c
index afb3bbd571f2..be7d299acd73 100644
--- a/net/sched/sch_atm.c
+++ b/net/sched/sch_atm.c
@@ -14,6 +14,7 @@
14#include <linux/netdevice.h> 14#include <linux/netdevice.h>
15#include <linux/rtnetlink.h> 15#include <linux/rtnetlink.h>
16#include <linux/file.h> /* for fput */ 16#include <linux/file.h> /* for fput */
17#include <net/netlink.h>
17#include <net/pkt_sched.h> 18#include <net/pkt_sched.h>
18#include <net/sock.h> 19#include <net/sock.h>
19 20
@@ -157,19 +158,6 @@ static unsigned long atm_tc_bind_filter(struct Qdisc *sch,
157 return atm_tc_get(sch,classid); 158 return atm_tc_get(sch,classid);
158} 159}
159 160
160
161static void destroy_filters(struct atm_flow_data *flow)
162{
163 struct tcf_proto *filter;
164
165 while ((filter = flow->filter_list)) {
166 DPRINTK("destroy_filters: destroying filter %p\n",filter);
167 flow->filter_list = filter->next;
168 tcf_destroy(filter);
169 }
170}
171
172
173/* 161/*
174 * atm_tc_put handles all destructions, including the ones that are explicitly 162 * atm_tc_put handles all destructions, including the ones that are explicitly
175 * requested (atm_tc_destroy, etc.). The assumption here is that we never drop 163 * requested (atm_tc_destroy, etc.). The assumption here is that we never drop
@@ -194,7 +182,7 @@ static void atm_tc_put(struct Qdisc *sch, unsigned long cl)
194 *prev = flow->next; 182 *prev = flow->next;
195 DPRINTK("atm_tc_put: qdisc %p\n",flow->q); 183 DPRINTK("atm_tc_put: qdisc %p\n",flow->q);
196 qdisc_destroy(flow->q); 184 qdisc_destroy(flow->q);
197 destroy_filters(flow); 185 tcf_destroy_chain(flow->filter_list);
198 if (flow->sock) { 186 if (flow->sock) {
199 DPRINTK("atm_tc_put: f_count %d\n", 187 DPRINTK("atm_tc_put: f_count %d\n",
200 file_count(flow->sock->file)); 188 file_count(flow->sock->file));
@@ -503,7 +491,7 @@ static void sch_atm_dequeue(unsigned long data)
503 } 491 }
504 D2PRINTK("atm_tc_dequeue: sending on class %p\n",flow); 492 D2PRINTK("atm_tc_dequeue: sending on class %p\n",flow);
505 /* remove any LL header somebody else has attached */ 493 /* remove any LL header somebody else has attached */
506 skb_pull(skb,(char *) skb->nh.iph-(char *) skb->data); 494 skb_pull(skb, skb_network_offset(skb));
507 if (skb_headroom(skb) < flow->hdr_len) { 495 if (skb_headroom(skb) < flow->hdr_len) {
508 struct sk_buff *new; 496 struct sk_buff *new;
509 497
@@ -513,7 +501,7 @@ static void sch_atm_dequeue(unsigned long data)
513 skb = new; 501 skb = new;
514 } 502 }
515 D2PRINTK("sch_atm_dequeue: ip %p, data %p\n", 503 D2PRINTK("sch_atm_dequeue: ip %p, data %p\n",
516 skb->nh.iph,skb->data); 504 skb_network_header(skb), skb->data);
517 ATM_SKB(skb)->vcc = flow->vcc; 505 ATM_SKB(skb)->vcc = flow->vcc;
518 memcpy(skb_push(skb,flow->hdr_len),flow->hdr, 506 memcpy(skb_push(skb,flow->hdr_len),flow->hdr,
519 flow->hdr_len); 507 flow->hdr_len);
@@ -610,7 +598,7 @@ static void atm_tc_destroy(struct Qdisc *sch)
610 DPRINTK("atm_tc_destroy(sch %p,[qdisc %p])\n",sch,p); 598 DPRINTK("atm_tc_destroy(sch %p,[qdisc %p])\n",sch,p);
611 /* races ? */ 599 /* races ? */
612 while ((flow = p->flows)) { 600 while ((flow = p->flows)) {
613 destroy_filters(flow); 601 tcf_destroy_chain(flow->filter_list);
614 if (flow->ref > 1) 602 if (flow->ref > 1)
615 printk(KERN_ERR "atm_destroy: %p->ref = %d\n",flow, 603 printk(KERN_ERR "atm_destroy: %p->ref = %d\n",flow,
616 flow->ref); 604 flow->ref);
@@ -631,7 +619,7 @@ static int atm_tc_dump_class(struct Qdisc *sch, unsigned long cl,
631{ 619{
632 struct atm_qdisc_data *p = PRIV(sch); 620 struct atm_qdisc_data *p = PRIV(sch);
633 struct atm_flow_data *flow = (struct atm_flow_data *) cl; 621 struct atm_flow_data *flow = (struct atm_flow_data *) cl;
634 unsigned char *b = skb->tail; 622 unsigned char *b = skb_tail_pointer(skb);
635 struct rtattr *rta; 623 struct rtattr *rta;
636 624
637 DPRINTK("atm_tc_dump_class(sch %p,[qdisc %p],flow %p,skb %p,tcm %p)\n", 625 DPRINTK("atm_tc_dump_class(sch %p,[qdisc %p],flow %p,skb %p,tcm %p)\n",
@@ -661,11 +649,11 @@ static int atm_tc_dump_class(struct Qdisc *sch, unsigned long cl,
661 649
662 RTA_PUT(skb,TCA_ATM_EXCESS,sizeof(zero),&zero); 650 RTA_PUT(skb,TCA_ATM_EXCESS,sizeof(zero),&zero);
663 } 651 }
664 rta->rta_len = skb->tail-b; 652 rta->rta_len = skb_tail_pointer(skb) - b;
665 return skb->len; 653 return skb->len;
666 654
667rtattr_failure: 655rtattr_failure:
668 skb_trim(skb,b-skb->data); 656 nlmsg_trim(skb, b);
669 return -1; 657 return -1;
670} 658}
671static int 659static int