Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Matt Johnston
dropbear
Commits
8393c5f0
Commit
8393c5f0
authored
Mar 19, 2013
by
Matt Johnston
Browse files
Allow specifying server "-p" options with ipv6 bracket notation,
patch from Ben Jencks
parent
5ff34120
Changes
1
Hide whitespace changes
Inline
Side-by-side
svr-runopts.c
View file @
8393c5f0
...
...
@@ -329,8 +329,23 @@ static void addportandaddress(char* spec) {
/* We don't free it, it becomes part of the runopt state */
myspec
=
m_strdup
(
spec
);
/* search for ':', that separates address and port */
svr_opts
.
ports
[
svr_opts
.
portcount
]
=
strrchr
(
myspec
,
':'
);
if
(
myspec
[
0
]
==
'['
)
{
myspec
++
;
svr_opts
.
ports
[
svr_opts
.
portcount
]
=
strchr
(
myspec
,
']'
);
if
(
svr_opts
.
ports
[
svr_opts
.
portcount
]
==
NULL
)
{
/* Unmatched [ -> exit */
dropbear_exit
(
"Bad listen address"
);
}
svr_opts
.
ports
[
svr_opts
.
portcount
][
0
]
=
'\0'
;
svr_opts
.
ports
[
svr_opts
.
portcount
]
++
;
if
(
svr_opts
.
ports
[
svr_opts
.
portcount
][
0
]
!=
':'
)
{
/* Missing port -> exit */
dropbear_exit
(
"Missing port"
);
}
}
else
{
/* search for ':', that separates address and port */
svr_opts
.
ports
[
svr_opts
.
portcount
]
=
strrchr
(
myspec
,
':'
);
}
if
(
svr_opts
.
ports
[
svr_opts
.
portcount
]
==
NULL
)
{
/* no ':' -> the whole string specifies just a port */
...
...
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