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
c9442675
Commit
c9442675
authored
Jul 25, 2003
by
Harald Welte
Committed by
David S. Miller
Jul 25, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[NETFILTER]: Fix a bug in the IRC DCC command parser of ip_conntrack_irc.
parent
c18abe7d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
4 deletions
+13
-4
net/ipv4/netfilter/ip_conntrack_irc.c
net/ipv4/netfilter/ip_conntrack_irc.c
+13
-4
No files found.
net/ipv4/netfilter/ip_conntrack_irc.c
View file @
c9442675
...
@@ -54,7 +54,7 @@ MODULE_PARM_DESC(dcc_timeout, "timeout on for unestablished DCC channels");
...
@@ -54,7 +54,7 @@ MODULE_PARM_DESC(dcc_timeout, "timeout on for unestablished DCC channels");
#endif
#endif
static
char
*
dccprotos
[]
=
{
"SEND "
,
"CHAT "
,
"MOVE "
,
"TSEND "
,
"SCHAT "
};
static
char
*
dccprotos
[]
=
{
"SEND "
,
"CHAT "
,
"MOVE "
,
"TSEND "
,
"SCHAT "
};
#define M
AXMATCHLEN 6
#define M
INMATCHLEN 5
DECLARE_LOCK
(
ip_irc_lock
);
DECLARE_LOCK
(
ip_irc_lock
);
struct
module
*
ip_conntrack_irc
=
THIS_MODULE
;
struct
module
*
ip_conntrack_irc
=
THIS_MODULE
;
...
@@ -87,9 +87,11 @@ int parse_dcc(char *data, char *data_end, u_int32_t * ip, u_int16_t * port,
...
@@ -87,9 +87,11 @@ int parse_dcc(char *data, char *data_end, u_int32_t * ip, u_int16_t * port,
*
ip
=
simple_strtoul
(
data
,
&
data
,
10
);
*
ip
=
simple_strtoul
(
data
,
&
data
,
10
);
/* skip blanks between ip and port */
/* skip blanks between ip and port */
while
(
*
data
==
' '
)
while
(
*
data
==
' '
)
{
if
(
data
>=
data_end
)
return
-
1
;
data
++
;
data
++
;
}
*
port
=
simple_strtoul
(
data
,
&
data
,
10
);
*
port
=
simple_strtoul
(
data
,
&
data
,
10
);
*
ad_end_p
=
data
;
*
ad_end_p
=
data
;
...
@@ -139,13 +141,17 @@ static int help(struct sk_buff *skb,
...
@@ -139,13 +141,17 @@ static int help(struct sk_buff *skb,
data
=
irc_buffer
;
data
=
irc_buffer
;
data_limit
=
irc_buffer
+
skb
->
len
-
dataoff
;
data_limit
=
irc_buffer
+
skb
->
len
-
dataoff
;
while
(
data
<
(
data_limit
-
(
22
+
MAXMATCHLEN
)))
{
/* strlen("\1DCC SENT t AAAAAAAA P\1\n")=24
* 5+MINMATCHLEN+strlen("t AAAAAAAA P\1\n")=14 */
while
(
data
<
(
data_limit
-
(
19
+
MINMATCHLEN
)))
{
if
(
memcmp
(
data
,
"
\1
DCC "
,
5
))
{
if
(
memcmp
(
data
,
"
\1
DCC "
,
5
))
{
data
++
;
data
++
;
continue
;
continue
;
}
}
data
+=
5
;
data
+=
5
;
/* we have at least (19+MINMATCHLEN)-5 bytes valid data left */
DEBUGP
(
"DCC found in master %u.%u.%u.%u:%u %u.%u.%u.%u:%u...
\n
"
,
DEBUGP
(
"DCC found in master %u.%u.%u.%u:%u %u.%u.%u.%u:%u...
\n
"
,
NIPQUAD
(
iph
->
saddr
),
ntohs
(
tcph
.
source
),
NIPQUAD
(
iph
->
saddr
),
ntohs
(
tcph
.
source
),
...
@@ -159,6 +165,9 @@ static int help(struct sk_buff *skb,
...
@@ -159,6 +165,9 @@ static int help(struct sk_buff *skb,
DEBUGP
(
"DCC %s detected
\n
"
,
dccprotos
[
i
]);
DEBUGP
(
"DCC %s detected
\n
"
,
dccprotos
[
i
]);
data
+=
strlen
(
dccprotos
[
i
]);
data
+=
strlen
(
dccprotos
[
i
]);
/* we have at least
* (19+MINMATCHLEN)-5-dccprotos[i].matchlen bytes valid
* data left (== 14/13 bytes) */
if
(
parse_dcc
((
char
*
)
data
,
data_limit
,
&
dcc_ip
,
if
(
parse_dcc
((
char
*
)
data
,
data_limit
,
&
dcc_ip
,
&
dcc_port
,
&
addr_beg_p
,
&
addr_end_p
))
{
&
dcc_port
,
&
addr_beg_p
,
&
addr_end_p
))
{
/* unable to parse */
/* unable to parse */
...
...
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