Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Unmaintained
Network Management
Commits
e3ed3cb5
Commit
e3ed3cb5
authored
Feb 12, 2013
by
Lamarque Souza
Browse files
Fix crash when parsing IPv6 configuration from dbus.
CCBUG: 314811
parent
332a1fae
Changes
2
Hide whitespace changes
Inline
Side-by-side
backends/NetworkManager/settings/ipv6dbus.cpp
View file @
e3ed3cb5
...
...
@@ -27,14 +27,16 @@ void Ipv6Dbus::fromMap(const QVariantMap & map)
setting
->
setMethod
(
methodStringToEnum
(
map
.
value
(
QLatin1String
(
NM_SETTING_IP6_CONFIG_METHOD
)).
value
<
QString
>
()));
}
if
(
map
.
contains
(
QLatin1String
(
NM_SETTING_IP6_CONFIG_DNS
)))
{
QDBusArgument
dnsArg
=
map
.
value
(
QLatin1String
(
NM_SETTING_IP6_CONFIG_DNS
)).
value
<
QDBusArgument
>
();
QList
<
QHostAddress
>
dbusDns
;
QList
<
QByteArray
>
temp
;
if
(
map
.
value
(
QLatin1String
(
NM_SETTING_IP6_CONFIG_DNS
)).
canConvert
<
QDBusArgument
>
())
{
QDBusArgument
dnsArg
=
map
.
value
(
QLatin1String
(
NM_SETTING_IP6_CONFIG_DNS
)).
value
<
QDBusArgument
>
();
temp
=
qdbus_cast
<
QList
<
QByteArray
>
>
(
dnsArg
);
}
else
{
temp
=
map
.
value
(
QLatin1String
(
NM_SETTING_IP6_CONFIG_DNS
)).
value
<
QList
<
QByteArray
>
>
();
}
dnsArg
.
beginArray
();
while
(
!
dnsArg
.
atEnd
())
{
QByteArray
utmp
;
dnsArg
>>
utmp
;
foreach
(
const
QByteArray
utmp
,
temp
)
{
Q_IPV6ADDR
tmp
;
for
(
int
i
=
0
;
i
<
16
;
i
++
)
{
...
...
@@ -55,15 +57,16 @@ void Ipv6Dbus::fromMap(const QVariantMap & map)
}
if
(
map
.
contains
(
QLatin1String
(
NM_SETTING_IP6_CONFIG_ADDRESSES
)))
{
QDBusArgument
addressArg
=
map
.
value
(
QLatin1String
(
NM_SETTING_IP6_CONFIG_ADDRESSES
)).
value
<
QDBusArgument
>
();
QList
<
IpV6AddressMap
>
temp
;
if
(
map
.
value
(
QLatin1String
(
NM_SETTING_IP6_CONFIG_DNS
)).
canConvert
<
QDBusArgument
>
())
{
QDBusArgument
addressArg
=
map
.
value
(
QLatin1String
(
NM_SETTING_IP6_CONFIG_ADDRESSES
)).
value
<
QDBusArgument
>
();
temp
=
qdbus_cast
<
QList
<
IpV6AddressMap
>
>
(
addressArg
);
}
else
{
temp
=
map
.
value
(
QLatin1String
(
NM_SETTING_IP6_CONFIG_ADDRESSES
)).
value
<
QList
<
IpV6AddressMap
>
>
();
}
QList
<
NetworkManager
::
IPv6Address
>
addresses
;
addressArg
.
beginArray
();
while
(
!
addressArg
.
atEnd
())
{
IpV6AddressMap
addressMap
;
addressArg
>>
addressMap
;
foreach
(
const
IpV6AddressMap
addressMap
,
temp
)
{
if
(
addressMap
.
address
.
isEmpty
()
||
!
addressMap
.
netMask
||
addressMap
.
gateway
.
isEmpty
())
{
kWarning
()
<<
"Invalid address format detected."
;
...
...
@@ -95,15 +98,16 @@ void Ipv6Dbus::fromMap(const QVariantMap & map)
if
(
map
.
contains
(
QLatin1String
(
NM_SETTING_IP6_CONFIG_ROUTES
)))
{
QDBusArgument
routeArg
=
map
.
value
(
QLatin1String
(
NM_SETTING_IP6_CONFIG_ROUTES
)).
value
<
QDBusArgument
>
();
QList
<
IpV6RouteMap
>
temp
;
if
(
map
.
value
(
QLatin1String
(
NM_SETTING_IP6_CONFIG_ROUTES
)).
canConvert
<
QDBusArgument
>
())
{
QDBusArgument
routeArg
=
map
.
value
(
QLatin1String
(
NM_SETTING_IP6_CONFIG_ROUTES
)).
value
<
QDBusArgument
>
();
temp
=
qdbus_cast
<
QList
<
IpV6RouteMap
>
>
(
routeArg
);
}
else
{
temp
=
map
.
value
(
QLatin1String
(
NM_SETTING_IP6_CONFIG_ROUTES
)).
value
<
QList
<
IpV6RouteMap
>
>
();
}
QList
<
NetworkManager
::
IPv6Route
>
routes
;
routeArg
.
beginArray
();
while
(
!
routeArg
.
atEnd
())
{
IpV6RouteMap
routeMap
;
routeArg
>>
routeMap
;
foreach
(
const
IpV6RouteMap
routeMap
,
temp
)
{
if
(
routeMap
.
route
.
isEmpty
()
||
!
routeMap
.
prefix
||
routeMap
.
nextHop
.
isEmpty
()
||
!
routeMap
.
metric
)
{
kWarning
()
<<
"Invalid route format detected."
;
...
...
plasma_nm_version.h
View file @
e3ed3cb5
#ifndef PLASMA_NM_VERSION_H
#define PLASMA_NM_VERSION_H
static
const
char
*
plasmaNmVersion
=
"0.9.1.70 (master 201302
0
1)"
;
static
const
char
*
plasmaNmVersion
=
"0.9.1.70 (master 2013021
2
)"
;
#endif
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