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
Kirill Smelkov
linux
Commits
e6694870
Commit
e6694870
authored
Feb 10, 2004
by
Grant Grundler
Committed by
Hideaki Yoshifuji
Feb 10, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PKTGEN]: Fix unintentional unaligned access.
parent
aff4f914
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
+12
-6
net/core/pktgen.c
net/core/pktgen.c
+12
-6
No files found.
net/core/pktgen.c
View file @
e6694870
...
@@ -50,6 +50,8 @@
...
@@ -50,6 +50,8 @@
* Fix refcount off by one if first packet fails, potential null deref,
* Fix refcount off by one if first packet fails, potential null deref,
* memleak 030710- KJP
* memleak 030710- KJP
*
*
* Fixed unaligned access on IA-64 Grant Grundler <grundler@parisc-linux.org>
*
* See Documentation/networking/pktgen.txt for how to use this.
* See Documentation/networking/pktgen.txt for how to use this.
*/
*/
...
@@ -88,7 +90,7 @@
...
@@ -88,7 +90,7 @@
#define cycles() ((u32)get_cycles())
#define cycles() ((u32)get_cycles())
#define VERSION "pktgen version 1.3
1
"
#define VERSION "pktgen version 1.3
2
"
static
char
version
[]
__initdata
=
static
char
version
[]
__initdata
=
"pktgen.c: v1.3: Packet Generator for packet performance testing.
\n
"
;
"pktgen.c: v1.3: Packet Generator for packet performance testing.
\n
"
;
...
@@ -193,7 +195,8 @@ struct pktgen_info {
...
@@ -193,7 +195,8 @@ struct pktgen_info {
struct
pktgen_hdr
{
struct
pktgen_hdr
{
__u32
pgh_magic
;
__u32
pgh_magic
;
__u32
seq_num
;
__u32
seq_num
;
struct
timeval
timestamp
;
__u32
tv_sec
;
__u32
tv_usec
;
};
};
static
int
cpu_speed
;
static
int
cpu_speed
;
...
@@ -563,11 +566,14 @@ static struct sk_buff *fill_packet(struct net_device *odev, struct pktgen_info*
...
@@ -563,11 +566,14 @@ static struct sk_buff *fill_packet(struct net_device *odev, struct pktgen_info*
/* Stamp the time, and sequence number, convert them to network byte order */
/* Stamp the time, and sequence number, convert them to network byte order */
if
(
pgh
)
{
if
(
pgh
)
{
struct
timeval
timestamp
;
pgh
->
pgh_magic
=
htonl
(
PKTGEN_MAGIC
);
pgh
->
pgh_magic
=
htonl
(
PKTGEN_MAGIC
);
do_gettimeofday
(
&
(
pgh
->
timestamp
));
pgh
->
timestamp
.
tv_usec
=
htonl
(
pgh
->
timestamp
.
tv_usec
);
pgh
->
timestamp
.
tv_sec
=
htonl
(
pgh
->
timestamp
.
tv_sec
);
pgh
->
seq_num
=
htonl
(
info
->
seq_num
);
pgh
->
seq_num
=
htonl
(
info
->
seq_num
);
do_gettimeofday
(
&
timestamp
);
pgh
->
tv_sec
=
htonl
(
timestamp
.
tv_sec
);
pgh
->
tv_usec
=
htonl
(
timestamp
.
tv_usec
);
}
}
return
skb
;
return
skb
;
...
...
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