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
72570ff1
Commit
72570ff1
authored
Oct 06, 2003
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[BPQETHER]: Fix packet handler to be PKT_CAN_SHARE_SKB.
parent
cd171fbd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
8 deletions
+21
-8
drivers/net/hamradio/bpqether.c
drivers/net/hamradio/bpqether.c
+21
-8
No files found.
drivers/net/hamradio/bpqether.c
View file @
72570ff1
...
@@ -105,6 +105,7 @@ static const char *bpq_print_ethaddr(const unsigned char *);
...
@@ -105,6 +105,7 @@ static const char *bpq_print_ethaddr(const unsigned char *);
static
struct
packet_type
bpq_packet_type
=
{
static
struct
packet_type
bpq_packet_type
=
{
.
type
=
__constant_htons
(
ETH_P_BPQ
),
.
type
=
__constant_htons
(
ETH_P_BPQ
),
.
func
=
bpq_rcv
,
.
func
=
bpq_rcv
,
.
data
=
PKT_CAN_SHARE_SKB
,
};
};
static
struct
notifier_block
bpq_dev_notifier
=
{
static
struct
notifier_block
bpq_dev_notifier
=
{
...
@@ -171,16 +172,17 @@ static int bpq_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_ty
...
@@ -171,16 +172,17 @@ static int bpq_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_ty
{
{
int
len
;
int
len
;
char
*
ptr
;
char
*
ptr
;
struct
ethhdr
*
eth
=
(
struct
ethhdr
*
)
skb
->
mac
.
raw
;
struct
ethhdr
*
eth
;
struct
bpqdev
*
bpq
;
struct
bpqdev
*
bpq
;
skb
->
sk
=
NULL
;
/* Initially we don't know who it's for */
if
(
!
pskb_may_pull
(
skb
,
sizeof
(
struct
ethhdr
)))
goto
drop
;
rcu_read_lock
();
rcu_read_lock
();
dev
=
bpq_get_ax25_dev
(
dev
);
dev
=
bpq_get_ax25_dev
(
dev
);
if
(
dev
==
NULL
||
!
netif_running
(
dev
))
if
(
dev
==
NULL
||
!
netif_running
(
dev
))
goto
drop
;
goto
drop
_unlock
;
/*
/*
* if we want to accept frames from just one ethernet device
* if we want to accept frames from just one ethernet device
...
@@ -189,11 +191,19 @@ static int bpq_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_ty
...
@@ -189,11 +191,19 @@ static int bpq_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_ty
bpq
=
(
struct
bpqdev
*
)
dev
->
priv
;
bpq
=
(
struct
bpqdev
*
)
dev
->
priv
;
if
(
!
(
bpq
->
acpt_addr
[
0
]
&
0x01
)
&&
memcmp
(
eth
->
h_source
,
bpq
->
acpt_addr
,
ETH_ALEN
))
{
eth
=
(
struct
ethhdr
*
)
skb
->
mac
.
raw
;
printk
(
KERN_DEBUG
"bpqether: wrong dest %s
\n
"
,
bpq_print_ethaddr
(
eth
->
h_source
));
goto
drop
;
if
(
!
(
bpq
->
acpt_addr
[
0
]
&
0x01
)
&&
memcmp
(
eth
->
h_source
,
bpq
->
acpt_addr
,
ETH_ALEN
))
{
if
(
net_ratelimit
())
printk
(
KERN_DEBUG
"bpqether: wrong dest %s
\n
"
,
bpq_print_ethaddr
(
eth
->
h_source
));
goto
drop_unlock
;
}
}
if
(
skb_cow
(
skb
,
sizeof
(
struct
ethhdr
)))
goto
drop_unlock
;
len
=
skb
->
data
[
0
]
+
skb
->
data
[
1
]
*
256
-
5
;
len
=
skb
->
data
[
0
]
+
skb
->
data
[
1
]
*
256
-
5
;
skb_pull
(
skb
,
2
);
/* Remove the length bytes */
skb_pull
(
skb
,
2
);
/* Remove the length bytes */
...
@@ -212,15 +222,18 @@ static int bpq_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_ty
...
@@ -212,15 +222,18 @@ static int bpq_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_ty
netif_rx
(
skb
);
netif_rx
(
skb
);
dev
->
last_rx
=
jiffies
;
dev
->
last_rx
=
jiffies
;
unlock:
unlock:
rcu_read_unlock
();
rcu_read_unlock
();
return
0
;
return
0
;
drop
:
drop_unlock
:
kfree_skb
(
skb
);
kfree_skb
(
skb
);
goto
unlock
;
goto
unlock
;
drop:
kfree_skb
(
skb
);
return
0
;
}
}
/*
/*
...
...
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