Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
R
radsecproxy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Code Review
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
eduroam
radsecproxy
Commits
2feba60a
Commit
2feba60a
authored
Apr 13, 2012
by
Linus Nordberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add top-level config options IPv4Only and IPv6Only.
Related to RADSECPROXY-37. TODO: Add documentation.
parent
883992d8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
3 deletions
+19
-3
radsecproxy.c
radsecproxy.c
+17
-3
radsecproxy.h
radsecproxy.h
+2
-0
No files found.
radsecproxy.c
View file @
2feba60a
...
...
@@ -2684,13 +2684,19 @@ int mergesrvconf(struct clsrvconf *dst, struct clsrvconf *src) {
return
1
;
}
int
config_hostaf
(
const
char
*
block
,
int
ipv4only
,
int
ipv6only
,
int
*
af
)
{
/** Set *AF according to IPV4ONLY and IPV6ONLY:
- If both are set, the function fails.
- If exactly one is set, *AF is set accordingly.
- If none is set, *AF is not affected.
Return 0 on success and !0 on failure.
In the case of an error, *AF is not affected. */
int
config_hostaf
(
const
char
*
desc
,
int
ipv4only
,
int
ipv6only
,
int
*
af
)
{
assert
(
af
!=
NULL
);
if
(
ipv4only
&&
ipv6only
)
{
debug
(
DBG_ERR
,
"error in block %s, at most one of IPv4Only and "
"IPv6Only can be enabled"
,
block
);
"IPv6Only can be enabled"
,
desc
);
return
-
1
;
}
*
af
=
AF_UNSPEC
;
if
(
ipv4only
)
*
af
=
AF_INET
;
if
(
ipv6only
)
...
...
@@ -2769,6 +2775,9 @@ int confclient_cb(struct gconffile **cf, void *arg, char *block, char *opt, char
}
#endif
conf
->
hostaf
=
AF_UNSPEC
;
if
(
config_hostaf
(
"top level"
,
options
.
ipv4only
,
options
.
ipv6only
,
&
conf
->
hostaf
))
debugx
(
1
,
DBG_ERR
,
"config error: ^"
);
if
(
config_hostaf
(
block
,
ipv4only
,
ipv6only
,
&
conf
->
hostaf
))
debugx
(
1
,
DBG_ERR
,
"error in block %s: ^"
,
block
);
...
...
@@ -2947,6 +2956,9 @@ int confserver_cb(struct gconffile **cf, void *arg, char *block, char *opt, char
free
(
conftype
);
conftype
=
NULL
;
conf
->
hostaf
=
AF_UNSPEC
;
if
(
config_hostaf
(
"top level"
,
options
.
ipv4only
,
options
.
ipv6only
,
&
conf
->
hostaf
))
debugx
(
1
,
DBG_ERR
,
"config error: ^"
);
if
(
config_hostaf
(
block
,
ipv4only
,
ipv6only
,
&
conf
->
hostaf
))
goto
errexit
;
...
...
@@ -3151,6 +3163,8 @@ void getmainconfig(const char *configfile) {
"FTicksKey"
,
CONF_STR
,
&
fticks_key_str
,
"FTicksSyslogFacility"
,
CONF_STR
,
&
options
.
ftickssyslogfacility
,
#endif
"IPv4Only"
,
CONF_BLN
,
&
options
.
ipv4only
,
"IPv6Only"
,
CONF_BLN
,
&
options
.
ipv6only
,
NULL
))
debugx
(
1
,
DBG_ERR
,
"configuration error"
);
...
...
radsecproxy.h
View file @
2feba60a
...
...
@@ -65,6 +65,8 @@ struct options {
enum
rsp_fticks_reporting_type
fticks_reporting
;
enum
rsp_fticks_mac_type
fticks_mac
;
uint8_t
*
fticks_key
;
uint8_t
ipv4only
;
uint8_t
ipv6only
;
};
struct
commonprotoopts
{
...
...
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