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
803cda72
Commit
803cda72
authored
Oct 02, 2003
by
Patrick McHardy
Committed by
Patrick McHardy
Oct 02, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[NETFILTER]: Fix REJECT is used in LOCAL_OUT.
parent
c5e4af1e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
net/ipv4/netfilter/ipt_REJECT.c
net/ipv4/netfilter/ipt_REJECT.c
+7
-6
No files found.
net/ipv4/netfilter/ipt_REJECT.c
View file @
803cda72
...
...
@@ -40,16 +40,17 @@ static void connection_attach(struct sk_buff *new_skb, struct nf_ct_info *nfct)
}
}
static
inline
struct
rtable
*
route_reverse
(
struct
sk_buff
*
skb
,
int
local
)
static
inline
struct
rtable
*
route_reverse
(
struct
sk_buff
*
skb
,
int
hook
)
{
struct
iphdr
*
iph
=
skb
->
nh
.
iph
;
struct
dst_entry
*
odst
;
struct
flowi
fl
=
{};
struct
rtable
*
rt
;
if
(
local
)
{
if
(
hook
!=
NF_IP_FORWARD
)
{
fl
.
nl_u
.
ip4_u
.
daddr
=
iph
->
saddr
;
fl
.
nl_u
.
ip4_u
.
saddr
=
iph
->
daddr
;
if
(
hook
==
NF_IP_LOCAL_IN
)
fl
.
nl_u
.
ip4_u
.
saddr
=
iph
->
daddr
;
fl
.
nl_u
.
ip4_u
.
tos
=
RT_TOS
(
iph
->
tos
);
if
(
ip_route_output_key
(
&
rt
,
&
fl
)
!=
0
)
...
...
@@ -81,7 +82,7 @@ static inline struct rtable *route_reverse(struct sk_buff *skb, int local)
}
/* Send RST reply */
static
void
send_reset
(
struct
sk_buff
*
oldskb
,
int
local
)
static
void
send_reset
(
struct
sk_buff
*
oldskb
,
int
hook
)
{
struct
sk_buff
*
nskb
;
struct
tcphdr
otcph
,
*
tcph
;
...
...
@@ -104,7 +105,7 @@ static void send_reset(struct sk_buff *oldskb, int local)
return
;
/* FIXME: Check checksum --RR */
if
((
rt
=
route_reverse
(
oldskb
,
local
))
==
NULL
)
if
((
rt
=
route_reverse
(
oldskb
,
hook
))
==
NULL
)
return
;
hh_len
=
(
rt
->
u
.
dst
.
dev
->
hard_header_len
+
15
)
&~
15
;
...
...
@@ -390,7 +391,7 @@ static unsigned int reject(struct sk_buff **pskb,
send_unreach
(
*
pskb
,
ICMP_PKT_FILTERED
);
break
;
case
IPT_TCP_RESET
:
send_reset
(
*
pskb
,
hooknum
==
NF_IP_LOCAL_IN
);
send_reset
(
*
pskb
,
hooknum
);
case
IPT_ICMP_ECHOREPLY
:
/* Doesn't happen. */
break
;
...
...
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