summaryrefslogtreecommitdiff
path: root/accel-pppd/shaper/limiter.c
diff options
context:
space:
mode:
authorKozlov Dmitry <xeb@mail.ru>2012-02-27 16:51:04 +0400
committerKozlov Dmitry <xeb@mail.ru>2012-02-27 16:51:04 +0400
commit0144238b8e364dac353797368fe45cda5426d88d (patch)
tree98e0dc6291d3736446bdcb7328adcad33ddfdee0 /accel-pppd/shaper/limiter.c
parent8a8680bfb817a25fdc04b6ce5e55605b1ac63d3d (diff)
downloadaccel-ppp-0144238b8e364dac353797368fe45cda5426d88d.tar.gz
accel-ppp-0144238b8e364dac353797368fe45cda5426d88d.zip
shaper: move thread local variables to stack
Diffstat (limited to 'accel-pppd/shaper/limiter.c')
-rw-r--r--accel-pppd/shaper/limiter.c30
1 files changed, 24 insertions, 6 deletions
diff --git a/accel-pppd/shaper/limiter.c b/accel-pppd/shaper/limiter.c
index 65861f72..ab0e67a4 100644
--- a/accel-pppd/shaper/limiter.c
+++ b/accel-pppd/shaper/limiter.c
@@ -24,12 +24,6 @@
#define TCA_BUF_MAX 64*1024
#define MAX_MSG 16384
-static __thread struct {
- struct nlmsghdr n;
- struct tcmsg t;
- char buf[TCA_BUF_MAX];
-} req;
-
struct qdisc_opt
{
char *kind;
@@ -129,6 +123,12 @@ static int qdisc_htb_class(struct qdisc_opt *qopt, struct nlmsghdr *n)
static int tc_qdisc_modify(struct rtnl_handle *rth, int ifindex, int cmd, unsigned flags, struct qdisc_opt *opt)
{
+ struct {
+ struct nlmsghdr n;
+ struct tcmsg t;
+ char buf[TCA_BUF_MAX];
+ } req;
+
memset(&req, 0, sizeof(req));
req.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct tcmsg));
@@ -209,6 +209,12 @@ static int install_police(struct rtnl_handle *rth, int ifindex, int rate, int bu
int mtu = 0, flowid = 1;
unsigned int linklayer = LINKLAYER_ETHERNET; /* Assume ethernet */
+ struct {
+ struct nlmsghdr n;
+ struct tcmsg t;
+ char buf[TCA_BUF_MAX];
+ } req;
+
struct qdisc_opt opt1 = {
.kind = "ingress",
.handle = 0xffff0000,
@@ -287,6 +293,12 @@ static int install_htb_ifb(struct rtnl_handle *rth, int ifindex, __u32 priority,
{
struct rtattr *tail, *tail1, *tail2, *tail3;
+ struct {
+ struct nlmsghdr n;
+ struct tcmsg t;
+ char buf[TCA_BUF_MAX];
+ } req;
+
struct qdisc_opt opt1 = {
.kind = "htb",
.handle = 0x00010001 + priority,
@@ -471,6 +483,12 @@ int init_ifb(const char *name)
struct rtattr *tail;
struct ifreq ifr;
int r;
+
+ struct {
+ struct nlmsghdr n;
+ struct tcmsg t;
+ char buf[TCA_BUF_MAX];
+ } req;
struct qdisc_opt opt = {
.kind = "htb",