cls_basic.c (e049d1ca3094f3d1d94617f456a9961202f96e3a) cls_basic.c (27a884dc3cb63b93c2b3b643f5b31eed5f8a4d26)
1/*
2 * net/sched/cls_basic.c Basic Packet Classifier.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
8 *

--- 231 unchanged lines hidden (view full) ---

240 arg->count++;
241 }
242}
243
244static int basic_dump(struct tcf_proto *tp, unsigned long fh,
245 struct sk_buff *skb, struct tcmsg *t)
246{
247 struct basic_filter *f = (struct basic_filter *) fh;
1/*
2 * net/sched/cls_basic.c Basic Packet Classifier.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
8 *

--- 231 unchanged lines hidden (view full) ---

240 arg->count++;
241 }
242}
243
244static int basic_dump(struct tcf_proto *tp, unsigned long fh,
245 struct sk_buff *skb, struct tcmsg *t)
246{
247 struct basic_filter *f = (struct basic_filter *) fh;
248 unsigned char *b = skb->tail;
248 unsigned char *b = skb_tail_pointer(skb);
249 struct rtattr *rta;
250
251 if (f == NULL)
252 return skb->len;
253
254 t->tcm_handle = f->handle;
255
256 rta = (struct rtattr *) b;
257 RTA_PUT(skb, TCA_OPTIONS, 0, NULL);
258
259 if (f->res.classid)
260 RTA_PUT(skb, TCA_BASIC_CLASSID, sizeof(u32), &f->res.classid);
261
262 if (tcf_exts_dump(skb, &f->exts, &basic_ext_map) < 0 ||
263 tcf_em_tree_dump(skb, &f->ematches, TCA_BASIC_EMATCHES) < 0)
264 goto rtattr_failure;
265
249 struct rtattr *rta;
250
251 if (f == NULL)
252 return skb->len;
253
254 t->tcm_handle = f->handle;
255
256 rta = (struct rtattr *) b;
257 RTA_PUT(skb, TCA_OPTIONS, 0, NULL);
258
259 if (f->res.classid)
260 RTA_PUT(skb, TCA_BASIC_CLASSID, sizeof(u32), &f->res.classid);
261
262 if (tcf_exts_dump(skb, &f->exts, &basic_ext_map) < 0 ||
263 tcf_em_tree_dump(skb, &f->ematches, TCA_BASIC_EMATCHES) < 0)
264 goto rtattr_failure;
265
266 rta->rta_len = (skb->tail - b);
266 rta->rta_len = skb_tail_pointer(skb) - b;
267 return skb->len;
268
269rtattr_failure:
270 skb_trim(skb, b - skb->data);
271 return -1;
272}
273
274static struct tcf_proto_ops cls_basic_ops = {

--- 27 unchanged lines hidden ---
267 return skb->len;
268
269rtattr_failure:
270 skb_trim(skb, b - skb->data);
271 return -1;
272}
273
274static struct tcf_proto_ops cls_basic_ops = {

--- 27 unchanged lines hidden ---