Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
NetworkManager-l2tp
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
CeRiAl
NetworkManager-l2tp
Commits
9aff6220
Commit
9aff6220
authored
Nov 17, 2014
by
Volkov Aleksey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More information for error in in IPSec setup and Fix error in start by check defaultroute
parent
79fd238a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
10 deletions
+35
-10
nm-l2tp-service.c
src/nm-l2tp-service.c
+35
-10
No files found.
src/nm-l2tp-service.c
View file @
9aff6220
...
...
@@ -648,11 +648,11 @@ l2tpd_watch_cb (GPid pid, gint status, gpointer user_data)
g_free
(
filename
);
filename
=
g_strdup_printf
(
"/var/run/nm-ipsec-l2tp.%d/ipsec.conf"
,
my_pid
);
//
unlink(filename);
unlink
(
filename
);
g_free
(
filename
);
filename
=
g_strdup_printf
(
"/var/run/nm-ipsec-l2tp.%d/ipsec.secrets"
,
my_pid
);
//
unlink(filename);
unlink
(
filename
);
g_free
(
filename
);
filename
=
g_strdup_printf
(
"/var/run/nm-ipsec-l2tp.%d"
,
my_pid
);
...
...
@@ -853,6 +853,7 @@ nm_l2tp_stop_ipsec(void)
char
session_name
[
128
];
GPtrArray
*
whack_argv
;
g_message
(
"ipsec prepare for shut down"
);
if
(
!
(
ipsec_binary
=
nm_find_ipsec
()))
return
;
sprintf
(
session_name
,
"nm-ipsec-l2tpd-%d"
,
getpid
());
...
...
@@ -887,6 +888,7 @@ nm_l2tp_start_ipsec(NML2tpPlugin *plugin,
char
cmd1
[
4096
],
cmd11
[
4096
],
cmd2
[
4096
];
char
session_name
[
128
];
guint
sys
=
0
;
guint
sys_tmp
=
0
;
FILE
*
fp
;
if
(
!
(
ipsec_binary
=
nm_find_ipsec
()))
{
...
...
@@ -901,10 +903,18 @@ nm_l2tp_start_ipsec(NML2tpPlugin *plugin,
sys
+=
system
(
"test -e /var/run/pluto/ipsec.info && . /var/run/pluto/ipsec.info;"
"PATH=/usr/local/sbin:/usr/sbin:/sbin; export PATH;"
"[
\"
x$defaultrouteaddr
\"
=
\"
x
\"
] && ipsec setup restart"
);
"if [
\"
x$defaultrouteaddr
\"
=
\"
x
\"
] ; then ipsec setup restart; fi"
);
if
(
sys
!=
sys_tmp
)
{
sys_tmp
=
sys
;
g_warning
(
"Possible error in IPSec setup: determine defaultrouteaddr or in
\"
ipsec setup restart
\"
"
);
}
sys
+=
system
(
"PATH=/usr/local/sbin:/usr/sbin:/sbin ipsec whack"
" --listen"
);
if
(
sys
!=
sys_tmp
)
{
sys_tmp
=
sys
;
g_warning
(
"Possible error in IPSec setup: ipsec whack --listen"
);
}
sprintf
(
cmd1
,
"test -e /var/run/pluto/ipsec.info && . /var/run/pluto/ipsec.info;"
"PATH=/usr/local/sbin:/usr/sbin:/sbin ipsec addconn "
" ${defaultrouteaddr:+--defaultroute} $defaultrouteaddr"
...
...
@@ -956,20 +966,34 @@ nm_l2tp_start_ipsec(NML2tpPlugin *plugin,
fclose
(
fp
);
sys
+=
system
(
"PATH=
\"
/sbin:/usr/sbin:/usr/local/sbin:$PATH
\"
ipsec secrets"
);
if
(
sys
!=
sys_tmp
)
{
sys_tmp
=
sys
;
g_warning
(
"Possible error in IPSec setup: ipsec secrets"
);
}
sys
+=
system
(
cmd11
);
if
(
sys
!=
sys_tmp
)
{
sys_tmp
=
sys
;
g_warning
(
"Possible error in IPSec setup: %s"
,
cmd11
);
}
sys
+=
system
(
cmd1
);
if
(
sys
!=
sys_tmp
)
{
sys_tmp
=
sys
;
g_warning
(
"Possible error in IPSec setup: %s"
,
cmd11
);
}
sys
+=
system
(
cmd2
);
if
(
sys
!=
sys_tmp
)
{
sys_tmp
=
sys
;
g_warning
(
"Possible error in IPSec setup: %s"
,
cmd11
);
}
rename
(
tmp_secrets
,
"/etc/ipsec.secrets"
);
sys
+=
system
(
"PATH=
\"
/sbin:/usr/sbin:/usr/local/sbin:$PATH
\"
ipsec secrets"
);
if
(
sys
!=
0
)
{
g_set_error
(
error
,
NM_VPN_PLUGIN_ERROR
,
NM_VPN_PLUGIN_ERROR_LAUNCH_FAILED
,
"%s"
,
_
(
"Possible error in IPSec setup."
));
return
FALSE
;
if
(
sys
!=
sys_tmp
)
{
sys_tmp
=
sys
;
g_warning
(
"Possible error in IPSec setup: ipsec secrets"
);
}
if
(
sys
!=
0
)
g_warning
(
"Possible error in IPSec setup."
);
g_message
(
_
(
"ipsec ready for action"
));
return
TRUE
;
...
...
@@ -1462,6 +1486,7 @@ real_connect (NMVPNPlugin *plugin,
g_message
(
_
(
"starting ipsec"
));
if
(
!
nm_l2tp_start_ipsec
(
NM_L2TP_PLUGIN
(
plugin
),
s_vpn
,
error
))
return
FALSE
;
priv
->
ipsec_up
=
TRUE
;
}
if
(
!
nm_l2tp_start_l2tpd_binary
(
NM_L2TP_PLUGIN
(
plugin
),
s_vpn
,
error
))
...
...
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