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
6ea8bb48
Commit
6ea8bb48
authored
Aug 30, 2003
by
Stephen Hemminger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[LLC]: Need to pskb_may_pull() in fix_up_incoming_skb().
parent
090e46fa
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
net/llc/llc_mac.c
net/llc/llc_mac.c
+10
-4
No files found.
net/llc/llc_mac.c
View file @
6ea8bb48
...
...
@@ -35,7 +35,7 @@
u8
llc_mac_null_var
[
IFHWADDRLEN
];
static
void
fix_up_incoming_skb
(
struct
sk_buff
*
skb
);
static
int
fix_up_incoming_skb
(
struct
sk_buff
*
skb
);
static
void
llc_station_rcv
(
struct
sk_buff
*
skb
);
static
void
llc_sap_rcv
(
struct
llc_sap
*
sap
,
struct
sk_buff
*
skb
);
...
...
@@ -69,7 +69,8 @@ int llc_rcv(struct sk_buff *skb, struct net_device *dev,
skb
=
skb_share_check
(
skb
,
GFP_ATOMIC
);
if
(
!
skb
)
goto
out
;
fix_up_incoming_skb
(
skb
);
if
(
!
fix_up_incoming_skb
(
skb
))
goto
drop
;
pdu
=
llc_pdu_sn_hdr
(
skb
);
if
(
!
pdu
->
dsap
)
{
/* NULL DSAP, refer to station */
dprintk
(
"%s: calling llc_station_rcv!
\n
"
,
__FUNCTION__
);
...
...
@@ -172,11 +173,15 @@ int llc_rcv(struct sk_buff *skb, struct net_device *dev,
* by looking at the two lowest-order bits of the first control field
* byte; field is either 3 or 4 bytes long.
*/
static
void
fix_up_incoming_skb
(
struct
sk_buff
*
skb
)
static
int
fix_up_incoming_skb
(
struct
sk_buff
*
skb
)
{
u8
llc_len
=
2
;
struct
llc_pdu_sn
*
pdu
=
(
struct
llc_pdu_sn
*
)
skb
->
data
;
struct
llc_pdu_sn
*
pdu
;
if
(
!
pskb_may_pull
(
skb
,
sizeof
(
*
pdu
)))
return
0
;
pdu
=
(
struct
llc_pdu_sn
*
)
skb
->
data
;
if
((
pdu
->
ctrl_1
&
LLC_PDU_TYPE_MASK
)
==
LLC_PDU_TYPE_U
)
llc_len
=
1
;
llc_len
+=
2
;
...
...
@@ -188,6 +193,7 @@ static void fix_up_incoming_skb(struct sk_buff *skb)
skb_trim
(
skb
,
data_size
);
}
return
1
;
}
/*
...
...
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