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
50cce6d2
Commit
50cce6d2
authored
Nov 27, 2004
by
Patrick McHardy
Committed by
David S. Miller
Nov 27, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[NETFILTER]: Save a level of indentation in icmp_reply_translation
Signed-off-by:
Patrick McHardy
<
kaber@trash.net
>
parent
9a8ce58a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
30 deletions
+26
-30
net/ipv4/netfilter/ip_nat_core.c
net/ipv4/netfilter/ip_nat_core.c
+26
-30
No files found.
net/ipv4/netfilter/ip_nat_core.c
View file @
50cce6d2
...
...
@@ -877,37 +877,33 @@ icmp_reply_translation(struct sk_buff **pskb,
if
(
info
->
manips
[
i
].
direction
!=
dir
)
continue
;
/* Mapping the inner packet is just like a normal
packet, except it was never src/dst reversed, so
where we would normally apply a dst manip, we apply
a src, and vice versa. */
if
(
info
->
manips
[
i
].
hooknum
==
hooknum
)
{
DEBUGP
(
"icmp_reply: inner %s -> %u.%u.%u.%u %u
\n
"
,
info
->
manips
[
i
].
maniptype
==
IP_NAT_MANIP_SRC
?
"DST"
:
"SRC"
,
NIPQUAD
(
info
->
manips
[
i
].
manip
.
ip
),
ntohs
(
info
->
manips
[
i
].
manip
.
u
.
udp
.
port
));
if
(
!
manip_pkt
(
inside
->
ip
.
protocol
,
pskb
,
(
*
pskb
)
->
nh
.
iph
->
ihl
*
4
+
sizeof
(
inside
->
icmp
),
&
info
->
manips
[
i
].
manip
,
!
info
->
manips
[
i
].
maniptype
))
goto
unlock_fail
;
/* Outer packet needs to have IP header NATed like
it's a reply. */
/* Mapping the inner packet is just like a normal packet, except
* it was never src/dst reversed, so where we would normally
* apply a dst manip, we apply a src, and vice versa. */
if
(
info
->
manips
[
i
].
hooknum
!=
hooknum
)
continue
;
/* Use mapping to map outer packet: 0 give no
per-proto mapping */
DEBUGP
(
"icmp_reply: outer %s -> %u.%u.%u.%u
\n
"
,
info
->
manips
[
i
].
maniptype
==
IP_NAT_MANIP_SRC
?
"SRC"
:
"DST"
,
NIPQUAD
(
info
->
manips
[
i
].
manip
.
ip
));
if
(
!
manip_pkt
(
0
,
pskb
,
0
,
&
info
->
manips
[
i
].
manip
,
info
->
manips
[
i
].
maniptype
))
goto
unlock_fail
;
}
DEBUGP
(
"icmp_reply: inner %s -> %u.%u.%u.%u %u
\n
"
,
info
->
manips
[
i
].
maniptype
==
IP_NAT_MANIP_SRC
?
"DST"
:
"SRC"
,
NIPQUAD
(
info
->
manips
[
i
].
manip
.
ip
),
ntohs
(
info
->
manips
[
i
].
manip
.
u
.
udp
.
port
));
if
(
!
manip_pkt
(
inside
->
ip
.
protocol
,
pskb
,
(
*
pskb
)
->
nh
.
iph
->
ihl
*
4
+
sizeof
(
inside
->
icmp
),
&
info
->
manips
[
i
].
manip
,
!
info
->
manips
[
i
].
maniptype
))
goto
unlock_fail
;
/* Outer packet needs to have IP header NATed like
it's a reply. */
/* Use mapping to map outer packet: 0 give no
per-proto mapping */
DEBUGP
(
"icmp_reply: outer %s -> %u.%u.%u.%u
\n
"
,
info
->
manips
[
i
].
maniptype
==
IP_NAT_MANIP_SRC
?
"SRC"
:
"DST"
,
NIPQUAD
(
info
->
manips
[
i
].
manip
.
ip
));
if
(
!
manip_pkt
(
0
,
pskb
,
0
,
&
info
->
manips
[
i
].
manip
,
info
->
manips
[
i
].
maniptype
))
goto
unlock_fail
;
}
READ_UNLOCK
(
&
ip_nat_lock
);
...
...
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