History log of /net/netfilter/xt_IDLETIMER.c
Revision Date Author Comments
415118692305d7a98731abc8068ab59b9c798e9a 10-Jul-2015 Dmitry Torokhov <dtor@google.com> nf: IDLETIMER: fix lockdep warning

Dynamically allocated sysfs attributes should be initialized with
sysfs_attr_init() otherwise lockdep will be angry with us:

[ 45.468653] BUG: key ffffffc030fad4e0 not in .data!
[ 45.468655] ------------[ cut here ]------------
[ 45.468666] WARNING: CPU: 0 PID: 1176 at /mnt/host/source/src/third_party/kernel/v3.18/kernel/locking/lockdep.c:2991 lockdep_init_map+0x12c/0x490()
[ 45.468672] DEBUG_LOCKS_WARN_ON(1)
[ 45.468672] CPU: 0 PID: 1176 Comm: iptables Tainted: G U W 3.18.0 #43
[ 45.468674] Hardware name: XXX
[ 45.468675] Call trace:
[ 45.468680] [<ffffffc0002072b4>] dump_backtrace+0x0/0x10c
[ 45.468683] [<ffffffc0002073d0>] show_stack+0x10/0x1c
[ 45.468688] [<ffffffc000a86cd4>] dump_stack+0x74/0x94
[ 45.468692] [<ffffffc000217ae0>] warn_slowpath_common+0x84/0xb0
[ 45.468694] [<ffffffc000217b84>] warn_slowpath_fmt+0x4c/0x58
[ 45.468697] [<ffffffc0002530a4>] lockdep_init_map+0x128/0x490
[ 45.468701] [<ffffffc000367ef0>] __kernfs_create_file+0x80/0xe4
[ 45.468704] [<ffffffc00036862c>] sysfs_add_file_mode_ns+0x104/0x170
[ 45.468706] [<ffffffc00036870c>] sysfs_create_file_ns+0x58/0x64
[ 45.468711] [<ffffffc000930430>] idletimer_tg_checkentry+0x14c/0x324
[ 45.468714] [<ffffffc00092a728>] xt_check_target+0x170/0x198
[ 45.468717] [<ffffffc000993efc>] check_target+0x58/0x6c
[ 45.468720] [<ffffffc000994c64>] translate_table+0x30c/0x424
[ 45.468723] [<ffffffc00099529c>] do_ipt_set_ctl+0x144/0x1d0
[ 45.468728] [<ffffffc0009079f0>] nf_setsockopt+0x50/0x60
[ 45.468732] [<ffffffc000946870>] ip_setsockopt+0x8c/0xb4
[ 45.468735] [<ffffffc0009661c0>] raw_setsockopt+0x10/0x50
[ 45.468739] [<ffffffc0008c1550>] sock_common_setsockopt+0x14/0x20
[ 45.468742] [<ffffffc0008bd190>] SyS_setsockopt+0x88/0xb8
[ 45.468744] ---[ end trace 41d156354d18c039 ]---

Change-Id: I1da5cd96fc8e1e1e4209e81eba1165a42d4d45e9
Signed-off-by: Dmitry Torokhov <dtor@google.com>
7ccfbeceea23c64d110cf8f77803f12d0bcee787 11-May-2015 Amit Pundir <amit.pundir@linaro.org> nf: IDLETIMER: Fix broken uid field in the msg

Create uid from kuid to fix the broken uid field
in the message notifications introduced in
Change-Id: I18fc73eada512e370d7ab24fc9f890845037b729,
Otherwise we run into following build error:
---------------
CC net/netfilter/xt_IDLETIMER.o
net/netfilter/xt_IDLETIMER.c: In function ‘reset_timer’:
net/netfilter/xt_IDLETIMER.c:360:16: error: incompatible types when assigning to type ‘uid_t’ from type ‘kuid_t’
make[2]: *** [net/netfilter/xt_IDLETIMER.o] Error 1
---------------

Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
(cherry picked from commit 706060ba3e1dee9ec3c4a4a1480d663b6cd71cad)

Change-Id: Ifd66df45a58d1a5a60c3816c373ee3008292eee8
246667e899473fece2c7ae7579943ca94a3acdb0 23-Apr-2015 Ruchi Kandoi <kandoiruchi@google.com> nf: IDLETIMER: Adds the uid field in the msg

Message notifications contains an additional uid field. This field
represents the uid that was responsible for waking the radio. And hence
it is present only in notifications stating that the radio is now
active.

Change-Id: I18fc73eada512e370d7ab24fc9f890845037b729
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
Bug: 20264396
456beeabbd99e214d0e5f2b80d0f3b8272dd9c79 24-Apr-2014 Ruchi Kandoi <kandoiruchi@google.com> nf: Remove compilation error caused by
e8430cbed3ef15fdb1ac26cfd020e010aa5f1c35

Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
44100a6c2fea149fb488af03bc839f601a35826b 26-Mar-2014 Ruchi Kandoi <kandoiruchi@google.com> nf: IDLETIMER: time-stamp and suspend/resume handling.

Message notifications contains an additional timestamp field in nano seconds.
The expiry time for the timers are modified during suspend/resume.
If timer was supposed to expire while the system is suspended then a
notification is sent when it resumes with the timestamp of the scheduled expiry.

Removes the race condition for multiple work scheduled.

Bug: 13247811

Change-Id: I752c5b00225fe7085482819f975cc0eb5af89bff
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
33919bff8776c8c30ca835feaf3e1bb2a3f111ec 05-Feb-2014 Ashish Sharma <ashishsharma@google.com> netfilter: xt_IDLETIMER: Revert to retain the kernel API format.

Reverted Change-Id: Iaeca5dd2d7878c0733923ae03309a2a7b86979ca

Change-Id: I0e0a4f60ec14330d8d8d1c5a508fa058d9919e07
Signed-off-by: Ashish Sharma <ashishsharma@google.com>
(cherry picked from commit e0a4e5b0e808d718dd9af500c5754118fc3935db)
04a64c1b4df0d66222fa422a46ad36ebf50f55ca 13-Aug-2012 Ashish Sharma <ashishsharma@google.com> netfilter: xt_IDLETIMER: Rename INTERFACE to LABEL in netlink notification.

Change-Id: Iaeca5dd2d7878c0733923ae03309a2a7b86979ca
Signed-off-by: Ashish Sharma <ashishsharma@google.com>
643e3850d3af0e1d5f1bef9d9cdbc1fc061a56c8 27-Apr-2012 JP Abgrall <jpa@google.com> netfilter: xt_IDLETIMER: Add new netlink msg type

Send notifications when the label becomes active after an idle period.
Send netlink message notifications in addition to sysfs notifications.
Using a uevent with
subsystem=xt_idletimer
INTERFACE=...
STATE={active,inactive}

This is backport from common android-3.0
commit: beb914e987cbbd368988d2b94a6661cb907c4d5a
with uevent support instead of a new netlink message type.

Change-Id: I31677ef00c94b5f82c8457e5bf9e5e584c23c523
Signed-off-by: Ashish Sharma <ashishsharma@google.com>
Signed-off-by: JP Abgrall <jpa@google.com>
0a9ee81349d90c6c85831f38118bf569c60a4d51 29-Aug-2011 Joe Perches <joe@perches.com> netfilter: Remove unnecessary OOM logging messages

Site specific OOM messages are duplications of a generic MM
out of memory message and aren't really useful, so just
delete them.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
f1e231a356f90a67f8547c2881a62c92084683c6 18-Jan-2011 Jan Engelhardt <jengelh@medozas.de> netfilter: xtables: add missing aliases for autoloading via iptables

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
600069daf792f497ae1e1da74e2fff6ac5de6c47 22-Jun-2010 Randy Dunlap <randy.dunlap@oracle.com> netfilter: xt_IDLETIMER needs kdev_t.h

Add header file to fix build error:
net/netfilter/xt_IDLETIMER.c:276: error: implicit declaration of function 'MKDEV'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
0902b469bd25065aa0688c3cee6f11744c817e7c 15-Jun-2010 Luciano Coelho <luciano.coelho@nokia.com> netfilter: xtables: idletimer target implementation

This patch implements an idletimer Xtables target that can be used to
identify when interfaces have been idle for a certain period of time.

Timers are identified by labels and are created when a rule is set with a new
label. The rules also take a timeout value (in seconds) as an option. If
more than one rule uses the same timer label, the timer will be restarted
whenever any of the rules get a hit.

One entry for each timer is created in sysfs. This attribute contains the
timer remaining for the timer to expire. The attributes are located under
the xt_idletimer class:

/sys/class/xt_idletimer/timers/<label>

When the timer expires, the target module sends a sysfs notification to the
userspace, which can then decide what to do (eg. disconnect to save power).

Cc: Timo Teras <timo.teras@iki.fi>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>