Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
4adae8d8
Commit
4adae8d8
authored
Feb 23, 2005
by
Robert Olsson
Committed by
David S. Miller
Feb 23, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PKTGEN]: reduce stack usage
From Randy Dunlap Signed-off-by:
David S. Miller
<
davem@davemloft.net
>
parent
dd9e5773
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
17 deletions
+6
-17
net/core/pktgen.c
net/core/pktgen.c
+6
-17
No files found.
net/core/pktgen.c
View file @
4adae8d8
...
@@ -151,7 +151,7 @@
...
@@ -151,7 +151,7 @@
#include <asm/timex.h>
#include <asm/timex.h>
#define VERSION "pktgen v2.5
7
: Packet Generator for packet performance testing.\n"
#define VERSION "pktgen v2.5
8
: Packet Generator for packet performance testing.\n"
/* #define PG_DEBUG(a) a */
/* #define PG_DEBUG(a) a */
#define PG_DEBUG(a)
#define PG_DEBUG(a)
...
@@ -811,6 +811,7 @@ static int proc_if_write(struct file *file, const char __user *user_buffer,
...
@@ -811,6 +811,7 @@ static int proc_if_write(struct file *file, const char __user *user_buffer,
struct
pktgen_dev
*
pkt_dev
=
(
struct
pktgen_dev
*
)(
data
);
struct
pktgen_dev
*
pkt_dev
=
(
struct
pktgen_dev
*
)(
data
);
char
*
pg_result
=
NULL
;
char
*
pg_result
=
NULL
;
int
tmp
=
0
;
int
tmp
=
0
;
char
buf
[
128
];
pg_result
=
&
(
pkt_dev
->
result
[
0
]);
pg_result
=
&
(
pkt_dev
->
result
[
0
]);
...
@@ -1071,7 +1072,6 @@ static int proc_if_write(struct file *file, const char __user *user_buffer,
...
@@ -1071,7 +1072,6 @@ static int proc_if_write(struct file *file, const char __user *user_buffer,
return
count
;
return
count
;
}
}
if
(
!
strcmp
(
name
,
"dst_min"
)
||
!
strcmp
(
name
,
"dst"
))
{
if
(
!
strcmp
(
name
,
"dst_min"
)
||
!
strcmp
(
name
,
"dst"
))
{
char
buf
[
IP_NAME_SZ
];
len
=
strn_len
(
&
user_buffer
[
i
],
sizeof
(
pkt_dev
->
dst_min
)
-
1
);
len
=
strn_len
(
&
user_buffer
[
i
],
sizeof
(
pkt_dev
->
dst_min
)
-
1
);
if
(
len
<
0
)
{
return
len
;
}
if
(
len
<
0
)
{
return
len
;
}
...
@@ -1091,7 +1091,6 @@ static int proc_if_write(struct file *file, const char __user *user_buffer,
...
@@ -1091,7 +1091,6 @@ static int proc_if_write(struct file *file, const char __user *user_buffer,
return
count
;
return
count
;
}
}
if
(
!
strcmp
(
name
,
"dst_max"
))
{
if
(
!
strcmp
(
name
,
"dst_max"
))
{
char
buf
[
IP_NAME_SZ
];
len
=
strn_len
(
&
user_buffer
[
i
],
sizeof
(
pkt_dev
->
dst_max
)
-
1
);
len
=
strn_len
(
&
user_buffer
[
i
],
sizeof
(
pkt_dev
->
dst_max
)
-
1
);
if
(
len
<
0
)
{
return
len
;
}
if
(
len
<
0
)
{
return
len
;
}
...
@@ -1112,9 +1111,7 @@ static int proc_if_write(struct file *file, const char __user *user_buffer,
...
@@ -1112,9 +1111,7 @@ static int proc_if_write(struct file *file, const char __user *user_buffer,
return
count
;
return
count
;
}
}
if
(
!
strcmp
(
name
,
"dst6"
))
{
if
(
!
strcmp
(
name
,
"dst6"
))
{
char
buf
[
128
];
len
=
strn_len
(
&
user_buffer
[
i
],
sizeof
(
buf
)
-
1
);
len
=
strn_len
(
&
user_buffer
[
i
],
128
-
1
);
if
(
len
<
0
)
return
len
;
if
(
len
<
0
)
return
len
;
pkt_dev
->
flags
|=
F_IPV6
;
pkt_dev
->
flags
|=
F_IPV6
;
...
@@ -1136,9 +1133,7 @@ static int proc_if_write(struct file *file, const char __user *user_buffer,
...
@@ -1136,9 +1133,7 @@ static int proc_if_write(struct file *file, const char __user *user_buffer,
return
count
;
return
count
;
}
}
if
(
!
strcmp
(
name
,
"dst6_min"
))
{
if
(
!
strcmp
(
name
,
"dst6_min"
))
{
char
buf
[
128
];
len
=
strn_len
(
&
user_buffer
[
i
],
sizeof
(
buf
)
-
1
);
len
=
strn_len
(
&
user_buffer
[
i
],
128
-
1
);
if
(
len
<
0
)
return
len
;
if
(
len
<
0
)
return
len
;
pkt_dev
->
flags
|=
F_IPV6
;
pkt_dev
->
flags
|=
F_IPV6
;
...
@@ -1159,9 +1154,7 @@ static int proc_if_write(struct file *file, const char __user *user_buffer,
...
@@ -1159,9 +1154,7 @@ static int proc_if_write(struct file *file, const char __user *user_buffer,
return
count
;
return
count
;
}
}
if
(
!
strcmp
(
name
,
"dst6_max"
))
{
if
(
!
strcmp
(
name
,
"dst6_max"
))
{
char
buf
[
128
];
len
=
strn_len
(
&
user_buffer
[
i
],
sizeof
(
buf
)
-
1
);
len
=
strn_len
(
&
user_buffer
[
i
],
128
-
1
);
if
(
len
<
0
)
return
len
;
if
(
len
<
0
)
return
len
;
pkt_dev
->
flags
|=
F_IPV6
;
pkt_dev
->
flags
|=
F_IPV6
;
...
@@ -1181,9 +1174,7 @@ static int proc_if_write(struct file *file, const char __user *user_buffer,
...
@@ -1181,9 +1174,7 @@ static int proc_if_write(struct file *file, const char __user *user_buffer,
return
count
;
return
count
;
}
}
if
(
!
strcmp
(
name
,
"src6"
))
{
if
(
!
strcmp
(
name
,
"src6"
))
{
char
buf
[
128
];
len
=
strn_len
(
&
user_buffer
[
i
],
sizeof
(
buf
)
-
1
);
len
=
strn_len
(
&
user_buffer
[
i
],
128
-
1
);
if
(
len
<
0
)
return
len
;
if
(
len
<
0
)
return
len
;
pkt_dev
->
flags
|=
F_IPV6
;
pkt_dev
->
flags
|=
F_IPV6
;
...
@@ -1205,7 +1196,6 @@ static int proc_if_write(struct file *file, const char __user *user_buffer,
...
@@ -1205,7 +1196,6 @@ static int proc_if_write(struct file *file, const char __user *user_buffer,
return
count
;
return
count
;
}
}
if
(
!
strcmp
(
name
,
"src_min"
))
{
if
(
!
strcmp
(
name
,
"src_min"
))
{
char
buf
[
IP_NAME_SZ
];
len
=
strn_len
(
&
user_buffer
[
i
],
sizeof
(
pkt_dev
->
src_min
)
-
1
);
len
=
strn_len
(
&
user_buffer
[
i
],
sizeof
(
pkt_dev
->
src_min
)
-
1
);
if
(
len
<
0
)
{
return
len
;
}
if
(
len
<
0
)
{
return
len
;
}
if
(
copy_from_user
(
buf
,
&
user_buffer
[
i
],
len
))
if
(
copy_from_user
(
buf
,
&
user_buffer
[
i
],
len
))
...
@@ -1224,7 +1214,6 @@ static int proc_if_write(struct file *file, const char __user *user_buffer,
...
@@ -1224,7 +1214,6 @@ static int proc_if_write(struct file *file, const char __user *user_buffer,
return
count
;
return
count
;
}
}
if
(
!
strcmp
(
name
,
"src_max"
))
{
if
(
!
strcmp
(
name
,
"src_max"
))
{
char
buf
[
IP_NAME_SZ
];
len
=
strn_len
(
&
user_buffer
[
i
],
sizeof
(
pkt_dev
->
src_max
)
-
1
);
len
=
strn_len
(
&
user_buffer
[
i
],
sizeof
(
pkt_dev
->
src_max
)
-
1
);
if
(
len
<
0
)
{
return
len
;
}
if
(
len
<
0
)
{
return
len
;
}
if
(
copy_from_user
(
buf
,
&
user_buffer
[
i
],
len
))
if
(
copy_from_user
(
buf
,
&
user_buffer
[
i
],
len
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment