sched, cls: check if we could overwrite actions when changing a filter
When actions are attached to a filter, they are a part of the filter itself, so when changing a filter we should allow to overwrite the actions inside as well. In my specific case, when I tried to _append_ a new action to an existing filter which already has an action, I got EEXIST since kernel refused to overwrite the existing one in kernel. This patch checks if we are changing the filter checking NLM_F_CREATE flag (Sigh, filters don't use NLM_F_REPLACE...) and then passes the boolean down to actions. This fixes the problem above. Cc: Jamal Hadi Salim <jhs@mojatatu.com> Cc: David S. Miller <davem@davemloft.net> Signed-off-by:Cong Wang <xiyou.wangcong@gmail.com> Signed-off-by:
Cong Wang <cwang@twopensource.com> Signed-off-by:
Jamal Hadi Salim <jhs@mojatatu.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
Showing
- include/net/pkt_cls.h 1 addition, 1 deletioninclude/net/pkt_cls.h
- include/net/sch_generic.h 1 addition, 1 deletioninclude/net/sch_generic.h
- net/sched/cls_api.c 5 additions, 4 deletionsnet/sched/cls_api.c
- net/sched/cls_basic.c 5 additions, 5 deletionsnet/sched/cls_basic.c
- net/sched/cls_bpf.c 5 additions, 5 deletionsnet/sched/cls_bpf.c
- net/sched/cls_cgroup.c 2 additions, 2 deletionsnet/sched/cls_cgroup.c
- net/sched/cls_flow.c 2 additions, 2 deletionsnet/sched/cls_flow.c
- net/sched/cls_fw.c 5 additions, 5 deletionsnet/sched/cls_fw.c
- net/sched/cls_route.c 6 additions, 5 deletionsnet/sched/cls_route.c
- net/sched/cls_rsvp.h 2 additions, 2 deletionsnet/sched/cls_rsvp.h
- net/sched/cls_tcindex.c 4 additions, 4 deletionsnet/sched/cls_tcindex.c
- net/sched/cls_u32.c 5 additions, 5 deletionsnet/sched/cls_u32.c
Please register or sign in to comment