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
66cfc254
Commit
66cfc254
authored
Apr 16, 2011
by
microcai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix to support nm-0.9
parent
cbfdb0c0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
38 deletions
+32
-38
nm-l2tp.c
properties/nm-l2tp.c
+13
-19
nm-l2tp-service.c
src/nm-l2tp-service.c
+19
-19
No files found.
properties/nm-l2tp.c
View file @
66cfc254
...
...
@@ -231,6 +231,9 @@ fill_password (GladeXML *xml,
{
GtkWidget
*
widget
=
NULL
;
gchar
*
password
=
NULL
;
NMSettingVPN
*
s_vpn
;
gboolean
unused
;
widget
=
glade_xml_get_widget
(
xml
,
widget_name
);
g_assert
(
widget
);
...
...
@@ -238,27 +241,18 @@ fill_password (GladeXML *xml,
if
(
!
connection
)
return
widget
;
password
=
NULL
;
if
(
nm_connection_get_scope
(
connection
)
==
NM_CONNECTION_SCOPE_SYSTEM
)
{
NMSettingVPN
*
s_vpn
;
s_vpn
=
(
NMSettingVPN
*
)
nm_connection_get_setting
(
connection
,
NM_TYPE_SETTING_VPN
);
if
(
s_vpn
)
{
const
gchar
*
tmp
=
NULL
;
/* Try the connection first */
s_vpn
=
(
NMSettingVPN
*
)
nm_connection_get_setting
(
connection
,
NM_TYPE_SETTING_VPN
);
if
(
s_vpn
)
{
const
gchar
*
tmp
=
NULL
;
tmp
=
nm_setting_vpn_get_secret
(
s_vpn
,
password_type
);
if
(
tmp
)
password
=
gnome_keyring_memory_strdup
(
tmp
);
}
}
else
{
NMSettingConnection
*
s_con
=
NULL
;
gboolean
unused
;
const
char
*
uuid
;
tmp
=
nm_setting_vpn_get_secret
(
s_vpn
,
password_type
);
if
(
tmp
)
password
=
gnome_keyring_memory_strdup
(
tmp
);
}
s_con
=
NM_SETTING_CONNECTION
(
nm_connection_get_setting
(
connection
,
NM_TYPE_SETTING_CONNECTION
));
uuid
=
nm_setting_connection_get_uuid
(
s_con
);
password
=
keyring_helpers_lookup_secret
(
uuid
,
if
(
!
password
)
{
password
=
keyring_helpers_lookup_secret
(
nm_connection_get_uuid
(
connection
),
password_type
,
&
unused
);
}
...
...
src/nm-l2tp-service.c
View file @
66cfc254
...
...
@@ -79,7 +79,7 @@ typedef struct {
GType
nm_l2tp_ppp_service_get_type
(
void
);
G_DEFINE_TYPE
(
NML2tpPppService
,
nm_l2tp_ppp_service
,
G_TYPE_OBJECT
)
G_DEFINE_TYPE
(
NML2tpPppService
,
nm_l2tp_ppp_service
,
G_TYPE_OBJECT
)
;
static
gboolean
impl_l2tp_service_need_secrets
(
NML2tpPppService
*
self
,
char
**
out_username
,
...
...
@@ -130,7 +130,7 @@ nm_l2tp_ppp_service_new (void)
connection
=
dbus_g_bus_get
(
DBUS_BUS_SYSTEM
,
&
error
);
if
(
!
connection
)
{
nm
_warning
(
"Could not get the system bus. Make sure "
g
_warning
(
"Could not get the system bus. Make sure "
"the message bus daemon is running! Message: %s"
,
error
->
message
);
g_error_free
(
error
);
...
...
@@ -152,7 +152,7 @@ nm_l2tp_ppp_service_new (void)
dbus_g_connection_register_g_object
(
connection
,
NM_DBUS_PATH_L2TP_PPP
,
object
);
success
=
TRUE
;
}
else
{
nm
_warning
(
"Could not register D-Bus service name. Message: %s"
,
error
->
message
);
g
_warning
(
"Could not register D-Bus service name. Message: %s"
,
error
->
message
);
g_error_free
(
error
);
g_object_unref
(
object
);
object
=
NULL
;
...
...
@@ -335,7 +335,7 @@ impl_l2tp_service_set_ip4_config (NML2tpPppService *self,
GHashTable
*
config_hash
,
GError
**
err
)
{
nm_info
(
"L2TP service (IP Config Get) reply received."
);
g_message
(
(
"L2TP service (IP Config Get) reply received."
)
);
g_signal_emit
(
G_OBJECT
(
self
),
signals
[
PLUGIN_ALIVE
],
0
);
/* Just forward the pppd plugin config up to our superclass; no need to modify it */
...
...
@@ -349,7 +349,7 @@ impl_l2tp_service_set_ip4_config (NML2tpPppService *self,
/* The VPN plugin service */
/********************************************************/
G_DEFINE_TYPE
(
NML2tpPlugin
,
nm_l2tp_plugin
,
NM_TYPE_VPN_PLUGIN
)
G_DEFINE_TYPE
(
NML2tpPlugin
,
nm_l2tp_plugin
,
NM_TYPE_VPN_PLUGIN
)
;
typedef
struct
{
GPid
pid
;
...
...
@@ -570,14 +570,14 @@ l2tpd_watch_cb (GPid pid, gint status, gpointer user_data)
if
(
WIFEXITED
(
status
))
{
error
=
WEXITSTATUS
(
status
);
if
(
error
!=
0
)
nm
_warning
(
"xl2tpd exited with error code %d"
,
error
);
g
_warning
(
"xl2tpd exited with error code %d"
,
error
);
}
else
if
(
WIFSTOPPED
(
status
))
nm
_warning
(
"xl2tpd stopped unexpectedly with signal %d"
,
WSTOPSIG
(
status
));
g
_warning
(
"xl2tpd stopped unexpectedly with signal %d"
,
WSTOPSIG
(
status
));
else
if
(
WIFSIGNALED
(
status
))
nm
_warning
(
"xl2tpd died with signal %d"
,
WTERMSIG
(
status
));
g
_warning
(
"xl2tpd died with signal %d"
,
WTERMSIG
(
status
));
else
nm
_warning
(
"xl2tpd died from an unknown cause"
);
g
_warning
(
"xl2tpd died from an unknown cause"
);
/* Reap child if needed. */
waitpid
(
priv
->
pid
,
NULL
,
WNOHANG
);
...
...
@@ -641,7 +641,7 @@ pppd_timed_out (gpointer user_data)
{
NML2tpPlugin
*
plugin
=
NM_L2TP_PLUGIN
(
user_data
);
nm
_warning
(
"Looks like pppd didn't initialize our dbus module"
);
g
_warning
(
"Looks like pppd didn't initialize our dbus module"
);
nm_vpn_plugin_failure
(
NM_VPN_PLUGIN
(
plugin
),
NM_VPN_CONNECTION_STATE_REASON_SERVICE_START_TIMEOUT
);
return
FALSE
;
...
...
@@ -721,13 +721,13 @@ get_l2tp_gw_address_as_gvalue (NMConnection *connection)
s_vpn
=
(
NMSettingVPN
*
)
nm_connection_get_setting
(
connection
,
NM_TYPE_SETTING_VPN
);
if
(
!
s_vpn
)
{
nm
_warning
(
"couldn't get VPN setting"
);
g
_warning
(
"couldn't get VPN setting"
);
return
NULL
;
}
p
=
tmp
=
nm_setting_vpn_get_data_item
(
s_vpn
,
NM_L2TP_KEY_GATEWAY
);
if
(
!
tmp
||
!
strlen
(
tmp
))
{
nm
_warning
(
"couldn't get L2TP VPN gateway IP address"
);
g
_warning
(
"couldn't get L2TP VPN gateway IP address"
);
return
NULL
;
}
...
...
@@ -751,7 +751,7 @@ get_l2tp_gw_address_as_gvalue (NMConnection *connection)
hints
.
ai_flags
=
AI_ADDRCONFIG
;
err
=
getaddrinfo
(
tmp
,
NULL
,
&
hints
,
&
result
);
if
(
err
!=
0
)
{
nm
_warning
(
"couldn't look up L2TP VPN gateway IP address '%s' (%d)"
,
tmp
,
err
);
g
_warning
(
"couldn't look up L2TP VPN gateway IP address '%s' (%d)"
,
tmp
,
err
);
return
NULL
;
}
...
...
@@ -773,7 +773,7 @@ get_l2tp_gw_address_as_gvalue (NMConnection *connection)
}
else
{
errno
=
0
;
if
(
inet_pton
(
AF_INET
,
tmp
,
&
addr
)
<=
0
)
{
nm
_warning
(
"couldn't convert L2TP VPN gateway IP address '%s' (%d)"
,
tmp
,
errno
);
g
_warning
(
"couldn't convert L2TP VPN gateway IP address '%s' (%d)"
,
tmp
,
errno
);
return
NULL
;
}
}
...
...
@@ -783,7 +783,7 @@ get_l2tp_gw_address_as_gvalue (NMConnection *connection)
g_value_init
(
value
,
G_TYPE_UINT
);
g_value_set_uint
(
value
,
(
guint32
)
addr
.
s_addr
);
}
else
nm
_warning
(
"couldn't determine L2TP VPN gateway IP address from '%s'"
,
tmp
);
g
_warning
(
"couldn't determine L2TP VPN gateway IP address from '%s'"
,
tmp
);
return
value
;
}
...
...
@@ -861,7 +861,7 @@ nm_l2tp_start_l2tpd_binary (NML2tpPlugin *plugin,
}
free_l2tpd_args
(
l2tpd_argv
);
nm_info
(
"xl2tpd started with pid %d"
,
pid
);
g_message
(
"xl2tpd started with pid %d"
,
pid
);
NM_L2TP_PLUGIN_GET_PRIVATE
(
plugin
)
->
pid
=
pid
;
g_child_watch_add
(
pid
,
l2tpd_watch_cb
,
plugin
);
...
...
@@ -1041,7 +1041,7 @@ nm_l2tp_config_write (NML2tpPlugin *plugin,
if
(
errno
==
0
)
{
write_config_option
(
pppopt_fd
,
"lcp-echo-failure %ld
\n
"
,
tmp_int
);
}
else
{
nm
_warning
(
"failed to convert lcp-echo-failure value '%s'"
,
value
);
g
_warning
(
"failed to convert lcp-echo-failure value '%s'"
,
value
);
}
}
else
{
write_config_option
(
pppopt_fd
,
"lcp-echo-failure 0
\n
"
);
...
...
@@ -1059,7 +1059,7 @@ nm_l2tp_config_write (NML2tpPlugin *plugin,
if
(
errno
==
0
)
{
write_config_option
(
pppopt_fd
,
"lcp-echo-interval %ld
\n
"
,
tmp_int
);
}
else
{
nm
_warning
(
"failed to convert lcp-echo-interval value '%s'"
,
value
);
g
_warning
(
"failed to convert lcp-echo-interval value '%s'"
,
value
);
}
}
else
{
write_config_option
(
pppopt_fd
,
"lcp-echo-interval 0
\n
"
);
...
...
@@ -1173,7 +1173,7 @@ real_disconnect (NMVPNPlugin *plugin,
else
kill
(
priv
->
pid
,
SIGKILL
);
nm_info
(
"Terminated ppp daemon with PID %d."
,
priv
->
pid
);
g_message
(
"Terminated ppp daemon with PID %d."
,
priv
->
pid
);
priv
->
pid
=
0
;
}
...
...
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