Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
NetworkManager
NetworkManager
Commits
92898e84
Commit
92898e84
authored
Jun 03, 2014
by
Jiří Klimeš
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tui: fix a crash when editing IPv6 routes
parent
ffd961fe
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
tui/nm-editor-bindings.c
tui/nm-editor-bindings.c
+7
-7
tui/nmt-route-entry.c
tui/nmt-route-entry.c
+1
-1
No files found.
tui/nm-editor-bindings.c
View file @
92898e84
...
...
@@ -772,7 +772,7 @@ ip6_addresses_to_strv (GBinding *binding,
for
(
i
=
0
;
i
<
addrs
->
len
;
i
++
)
{
addrbytes
=
addrs
->
pdata
[
i
];
if
(
IP6_ADDRESS_SET
(
addrbytes
))
inet_ntop
(
AF_INET
,
addrbytes
->
data
,
buf
,
sizeof
(
buf
));
inet_ntop
(
AF_INET
6
,
addrbytes
->
data
,
buf
,
sizeof
(
buf
));
else
buf
[
0
]
=
'\0'
;
strings
[
i
]
=
g_strdup
(
buf
);
...
...
@@ -1002,7 +1002,7 @@ ip6_route_transform_to_next_hop_string (GBinding *binding,
addrbytes
=
&
in6addr_any
;
if
(
IN6_ADDR_SET
(
addrbytes
))
inet_ntop
(
AF_INET
,
&
addrbytes
,
buf
,
sizeof
(
buf
));
inet_ntop
(
AF_INET
6
,
addrbytes
,
buf
,
sizeof
(
buf
));
else
buf
[
0
]
=
'\0'
;
g_value_set_string
(
target_value
,
buf
);
...
...
@@ -1035,7 +1035,7 @@ ip6_route_transform_from_dest_string (GBinding *binding,
{
NMIP6Route
*
route
;
const
char
*
text
;
const
struct
in6_addr
*
addrbytes
;
struct
in6_addr
addrbytes
;
guint32
prefix
;
text
=
g_value_get_string
(
source_value
);
...
...
@@ -1047,7 +1047,7 @@ ip6_route_transform_from_dest_string (GBinding *binding,
g_binding_get_source_property
(
binding
),
&
route
,
NULL
);
nm_ip6_route_set_dest
(
route
,
addrbytes
);
nm_ip6_route_set_dest
(
route
,
&
addrbytes
);
nm_ip6_route_set_prefix
(
route
,
prefix
);
g_value_take_boxed
(
target_value
,
route
);
...
...
@@ -1062,21 +1062,21 @@ ip6_route_transform_from_next_hop_string (GBinding *binding,
{
NMIP6Route
*
route
;
const
char
*
text
;
const
struct
in6_addr
*
addrbytes
;
struct
in6_addr
addrbytes
;
text
=
g_value_get_string
(
source_value
);
if
(
*
text
)
{
if
(
!
ip_string_parse
(
text
,
AF_INET6
,
&
addrbytes
,
NULL
))
return
FALSE
;
}
else
addrbytes
=
0
;
addrbytes
=
in6addr_any
;
/* Fetch the original property value */
g_object_get
(
g_binding_get_source
(
binding
),
g_binding_get_source_property
(
binding
),
&
route
,
NULL
);
nm_ip6_route_set_next_hop
(
route
,
addrbytes
);
nm_ip6_route_set_next_hop
(
route
,
&
addrbytes
);
g_value_take_boxed
(
target_value
,
route
);
return
TRUE
;
...
...
tui/nmt-route-entry.c
View file @
92898e84
...
...
@@ -206,7 +206,7 @@ nmt_route_entry_set_property (GObject *object,
priv
->
ip4_route
=
g_value_dup_boxed
(
value
);
break
;
case
PROP_IP6_ROUTE
:
g_return_if_fail
(
priv
->
family
==
AF_INET
);
g_return_if_fail
(
priv
->
family
==
AF_INET
6
);
if
(
priv
->
ip6_route
)
nm_ip6_route_unref
(
priv
->
ip6_route
);
priv
->
ip6_route
=
g_value_dup_boxed
(
value
);
...
...
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