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
061af250
Commit
061af250
authored
Mar 02, 2003
by
Chas Williams
Committed by
David S. Miller
Mar 02, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ATM]: Get minimum frame size right in lec.c
parent
97d10a80
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
17 deletions
+19
-17
net/atm/lec.c
net/atm/lec.c
+16
-17
net/atm/lec.h
net/atm/lec.h
+3
-0
No files found.
net/atm/lec.c
View file @
061af250
...
...
@@ -223,7 +223,8 @@ lec_send_packet(struct sk_buff *skb, struct net_device *dev)
struct
lecdatahdr_8023
*
lec_h
;
struct
atm_vcc
*
send_vcc
;
struct
lec_arp_table
*
entry
;
unsigned
char
*
nb
,
*
dst
;
unsigned
char
*
dst
;
int
min_frame_size
;
#ifdef CONFIG_TR
unsigned
char
rdesc
[
ETH_ALEN
];
/* Token Ring route descriptor */
#endif
...
...
@@ -294,26 +295,24 @@ lec_send_packet(struct sk_buff *skb, struct net_device *dev)
#endif
/* DUMP_PACKETS > 0 */
/* Minimum ethernet-frame size */
if
(
skb
->
len
<
62
)
{
if
(
skb
->
truesize
<
62
)
{
printk
(
"%s:data packet %d / %d
\n
"
,
dev
->
name
,
skb
->
len
,
skb
->
truesize
);
nb
=
(
unsigned
char
*
)
kmalloc
(
64
,
GFP_ATOMIC
);
if
(
nb
==
NULL
)
{
#ifdef CONFIG_TR
if
(
priv
->
is_trdev
)
min_frame_size
=
LEC_MINIMUM_8025_SIZE
;
else
#endif
min_frame_size
=
LEC_MINIMUM_8023_SIZE
;
if
(
skb
->
len
<
min_frame_size
)
{
if
(
skb
->
truesize
<
min_frame_size
)
{
skb2
=
skb_copy_expand
(
skb
,
0
,
min_frame_size
-
skb
->
truesize
,
GFP_ATOMIC
);
dev_kfree_skb
(
skb
);
if
(
skb2
==
NULL
)
{
priv
->
stats
.
tx_dropped
++
;
return
0
;
}
memcpy
(
nb
,
skb
->
data
,
skb
->
len
);
kfree
(
skb
->
head
);
skb
->
head
=
skb
->
data
=
nb
;
skb
->
tail
=
nb
+
62
;
skb
->
end
=
nb
+
64
;
skb
->
len
=
62
;
skb
->
truesize
=
64
;
}
else
{
skb
->
len
=
62
;
skb
=
skb2
;
}
skb_put
(
skb
,
min_frame_size
-
skb
->
len
);
}
/* Send to right vcc */
...
...
net/atm/lec.h
View file @
061af250
...
...
@@ -38,6 +38,9 @@ struct lecdatahdr_8025 {
unsigned
char
h_source
[
ETH_ALEN
];
};
#define LEC_MINIMUM_8023_SIZE 62
#define LEC_MINIMUM_8025_SIZE 16
/*
* Operations that LANE2 capable device can do. Two first functions
* are used to make the device do things. See spec 3.1.3 and 3.1.4.
...
...
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