Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
babeld
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
babeld
Commits
3d85b845
Commit
3d85b845
authored
Mar 16, 2009
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow quoted strings for interface names.
parent
8ce20c01
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
1 deletion
+36
-1
config.c
config.c
+36
-1
No files found.
config.c
View file @
3d85b845
...
@@ -74,6 +74,41 @@ getword(int c, char **token_r, gnc_t gnc, void *closure)
...
@@ -74,6 +74,41 @@ getword(int c, char **token_r, gnc_t gnc, void *closure)
return
c
;
return
c
;
}
}
static
int
getstring
(
int
c
,
char
**
token_r
,
gnc_t
gnc
,
void
*
closure
)
{
char
buf
[
256
];
int
i
=
0
;
c
=
skip_whitespace
(
c
,
gnc
,
closure
);
if
(
c
<
0
)
return
c
;
if
(
c
==
'\n'
)
return
-
2
;
/* Unquoted strings have the same syntax as words. */
if
(
c
!=
'"'
)
return
getword
(
c
,
token_r
,
gnc
,
closure
);
c
=
gnc
(
closure
);
while
(
1
)
{
if
(
i
>=
255
||
c
==
'\n'
)
return
-
2
;
if
(
c
==
'"'
)
{
c
=
gnc
(
closure
);
break
;
}
if
(
c
==
'\\'
)
c
=
gnc
(
closure
);
buf
[
i
++
]
=
c
;
c
=
gnc
(
closure
);
}
buf
[
i
]
=
'\0'
;
*
token_r
=
strdup
(
buf
);
return
c
;
}
static
int
static
int
getint
(
int
c
,
int
*
int_r
,
gnc_t
gnc
,
void
*
closure
)
getint
(
int
c
,
int
*
int_r
,
gnc_t
gnc
,
void
*
closure
)
{
{
...
@@ -249,7 +284,7 @@ parse_filter(gnc_t gnc, void *closure)
...
@@ -249,7 +284,7 @@ parse_filter(gnc_t gnc, void *closure)
filter
->
proto
=
RTPROT_BABEL_LOCAL
;
filter
->
proto
=
RTPROT_BABEL_LOCAL
;
}
else
if
(
strcmp
(
token
,
"if"
)
==
0
)
{
}
else
if
(
strcmp
(
token
,
"if"
)
==
0
)
{
char
*
interface
;
char
*
interface
;
c
=
get
word
(
c
,
&
interface
,
gnc
,
closure
);
c
=
get
string
(
c
,
&
interface
,
gnc
,
closure
);
if
(
c
<
-
1
)
if
(
c
<
-
1
)
goto
error
;
goto
error
;
filter
->
ifname
=
interface
;
filter
->
ifname
=
interface
;
...
...
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