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
1de9243b
Commit
1de9243b
authored
Jul 11, 2012
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ipv4: Pull icmp socket delivery out into a helper function.
Signed-off-by:
David S. Miller
<
davem@davemloft.net
>
parent
46d3ceab
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
15 deletions
+16
-15
net/ipv4/icmp.c
net/ipv4/icmp.c
+16
-15
No files found.
net/ipv4/icmp.c
View file @
1de9243b
...
...
@@ -634,18 +634,31 @@ out:;
EXPORT_SYMBOL
(
icmp_send
);
static
void
icmp_socket_deliver
(
struct
sk_buff
*
skb
,
u32
info
)
{
const
struct
iphdr
*
iph
=
(
const
struct
iphdr
*
)
skb
->
data
;
const
struct
net_protocol
*
ipprot
;
int
protocol
=
iph
->
protocol
;
raw_icmp_error
(
skb
,
protocol
,
info
);
rcu_read_lock
();
ipprot
=
rcu_dereference
(
inet_protos
[
protocol
]);
if
(
ipprot
&&
ipprot
->
err_handler
)
ipprot
->
err_handler
(
skb
,
info
);
rcu_read_unlock
();
}
/*
* Handle ICMP_DEST_UNREACH, ICMP_TIME_EXCEED, and ICMP_QUENCH.
*/
static
void
icmp_unreach
(
struct
sk_buff
*
skb
)
{
const
struct
net_protocol
*
ipprot
;
const
struct
iphdr
*
iph
;
struct
icmphdr
*
icmph
;
struct
net
*
net
;
u32
info
=
0
;
int
protocol
;
net
=
dev_net
(
skb_dst
(
skb
)
->
dev
);
...
...
@@ -726,19 +739,7 @@ static void icmp_unreach(struct sk_buff *skb)
if
(
!
pskb_may_pull
(
skb
,
iph
->
ihl
*
4
+
8
))
goto
out
;
iph
=
(
const
struct
iphdr
*
)
skb
->
data
;
protocol
=
iph
->
protocol
;
/*
* Deliver ICMP message to raw sockets. Pretty useless feature?
*/
raw_icmp_error
(
skb
,
protocol
,
info
);
rcu_read_lock
();
ipprot
=
rcu_dereference
(
inet_protos
[
protocol
]);
if
(
ipprot
&&
ipprot
->
err_handler
)
ipprot
->
err_handler
(
skb
,
info
);
rcu_read_unlock
();
icmp_socket_deliver
(
skb
,
info
);
out:
return
;
...
...
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