summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a89344a)
raw | patch | inline | side by side (parent: a89344a)
author | Praneeth Bajjuri <praneeth@ti.com> | |
Mon, 4 May 2015 22:31:50 +0000 (17:31 -0500) | ||
committer | Praneeth Bajjuri <praneeth@ti.com> | |
Mon, 4 May 2015 22:32:48 +0000 (17:32 -0500) |
This reverts commit 87ae7641a1bfd064993b2b92e365b72fbf2effa1.
This patch causes build break. so temporarily reverting it.
Change-Id: I6532f56c470450bdc39e26e005b76c2175d11873
TODO: Fix properly and push a patch on top
Signed-off-by: Praneeth Bajjuri <praneeth@ti.com>
This patch causes build break. so temporarily reverting it.
Change-Id: I6532f56c470450bdc39e26e005b76c2175d11873
TODO: Fix properly and push a patch on top
Signed-off-by: Praneeth Bajjuri <praneeth@ti.com>
net/netfilter/xt_IDLETIMER.c | patch | blob | history |
index ddf77f7fbe245069b9f5d151f974d5b98b220282..f6562ba97a978a8b9deeb433e922d5d6fb28ea8f 100644 (file)
#include <linux/suspend.h>
#include <linux/notifier.h>
#include <net/net_namespace.h>
-#include <net/sock.h>
struct idletimer_tg_attr {
struct attribute attr;
bool work_pending;
bool send_nl_msg;
bool active;
- uid_t uid;
};
static LIST_HEAD(idletimer_tg_list);
@@ -119,8 +117,7 @@ static void notify_netlink_uevent(const char *iface, struct idletimer_tg *timer)
char iface_msg[NLMSG_MAX_SIZE];
char state_msg[NLMSG_MAX_SIZE];
char timestamp_msg[NLMSG_MAX_SIZE];
- char uid_msg[NLMSG_MAX_SIZE];
- char *envp[] = { iface_msg, state_msg, timestamp_msg, uid_msg, NULL };
+ char *envp[] = { iface_msg, state_msg, timestamp_msg, NULL };
int res;
struct timespec ts;
uint64_t time_ns;
@@ -143,16 +140,6 @@ static void notify_netlink_uevent(const char *iface, struct idletimer_tg *timer)
return;
}
- if (state) {
- res = snprintf(uid_msg, NLMSG_MAX_SIZE, "UID=%u", timer->uid);
- if (NLMSG_MAX_SIZE <= res)
- pr_err("message too long (%d)", res);
- } else {
- res = snprintf(uid_msg, NLMSG_MAX_SIZE, "UID=");
- if (NLMSG_MAX_SIZE <= res)
- pr_err("message too long (%d)", res);
- }
-
time_ns = timespec_to_ns(&ts);
res = snprintf(timestamp_msg, NLMSG_MAX_SIZE, "TIME_NS=%llu", time_ns);
if (NLMSG_MAX_SIZE <= res) {
@@ -160,8 +147,7 @@ static void notify_netlink_uevent(const char *iface, struct idletimer_tg *timer)
pr_err("message too long (%d)", res);
}
- pr_debug("putting nlmsg: <%s> <%s> <%s> <%s>\n", iface_msg, state_msg,
- timestamp_msg, uid_msg);
+ pr_debug("putting nlmsg: <%s> <%s>\n", iface_msg, state_msg);
kobject_uevent_env(idletimer_tg_kobj, KOBJ_CHANGE, envp);
return;
info->timer->delayed_timer_trigger.tv_sec = 0;
info->timer->delayed_timer_trigger.tv_nsec = 0;
info->timer->work_pending = false;
- info->timer->uid = 0;
get_monotonic_boottime(&info->timer->last_modified_timer);
info->timer->pm_nb.notifier_call = idletimer_resume;
return ret;
}
-static void reset_timer(const struct idletimer_tg_info *info,
- struct sk_buff *skb)
+static void reset_timer(const struct idletimer_tg_info *info)
{
unsigned long now = jiffies;
struct idletimer_tg *timer = info->timer;
if (!timer_prev || time_before(timer->timer.expires, now)) {
pr_debug("Starting Checkentry timer (Expired, Jiffies): %lu, %lu\n",
timer->timer.expires, now);
-
- /* Stores the uid resposible for waking up the radio */
- if (skb && (skb->sk)) {
- struct sock *sk = skb->sk;
- read_lock_bh(&sk->sk_callback_lock);
- if ((sk->sk_socket) && (sk->sk_socket->file) &&
- (sk->sk_socket->file->f_cred))
- timer->uid = sk->sk_socket->file->f_cred->uid;
- read_unlock_bh(&sk->sk_callback_lock);
- }
-
/* checks if there is a pending inactive notification*/
if (timer->work_pending)
timer->delayed_timer_trigger = timer->last_modified_timer;
}
/* TODO: Avoid modifying timers on each packet */
- reset_timer(info, skb);
+ reset_timer(info);
return XT_CONTINUE;
}
info->timer = __idletimer_tg_find_by_label(info->label);
if (info->timer) {
info->timer->refcnt++;
- reset_timer(info, NULL);
+ reset_timer(info);
pr_debug("increased refcnt of timer %s to %u\n",
info->label, info->timer->refcnt);
} else {