]> git.baikalelectronics.ru Git - kernel.git/commit
net: filter: simplify socket charging
authorAlexei Starovoitov <ast@plumgrid.com>
Thu, 31 Jul 2014 03:34:12 +0000 (20:34 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sat, 2 Aug 2014 22:02:37 +0000 (15:02 -0700)
commitc8fcd0e5c33051097488fd04d7a78dad56cd17e2
tree51ff4143d22b2e550308681c938afc7c9c10dcdc
parentd14ef5a735be695fc2962210b43b1483ab4e86c0
net: filter: simplify socket charging

attaching bpf program to a socket involves multiple socket memory arithmetic,
since size of 'sk_filter' is changing when classic BPF is converted to eBPF.
Also common path of program creation has to deal with two ways of freeing
the memory.

Simplify the code by delaying socket charging until program is ready and
its size is known

Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/filter.h
net/core/filter.c
net/core/sock.c