[gupnp] Use proper macros for accessing NL address message
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gupnp] Use proper macros for accessing NL address message
- Date: Thu, 31 Dec 2015 10:57:15 +0000 (UTC)
commit 4c7abf33b0da9ba009fd577ae6feced66e6c023c
Author: Jens Georg <mail jensge org>
Date: Fri Dec 4 22:07:22 2015 +0100
Use proper macros for accessing NL address message
RTM_*ADDRESS rt_attr was wrongly parsed using IFLA_* macros instead of
IFA_* macros, probably causing some rt_attrs to be missed.
libgupnp/gupnp-linux-context-manager.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/libgupnp/gupnp-linux-context-manager.c b/libgupnp/gupnp-linux-context-manager.c
index 46a5408..3ed4448 100644
--- a/libgupnp/gupnp-linux-context-manager.c
+++ b/libgupnp/gupnp-linux-context-manager.c
@@ -330,8 +330,8 @@ extract_info (struct nlmsghdr *header, char **label)
int rt_attr_len;
struct rtattr *rt_attr;
- rt_attr = IFLA_RTA (NLMSG_DATA (header));
- rt_attr_len = IFLA_PAYLOAD (header);
+ rt_attr = IFA_RTA (NLMSG_DATA (header));
+ rt_attr_len = IFA_PAYLOAD (header);
while (RT_ATTR_OK (rt_attr, rt_attr_len)) {
if (rt_attr->rta_type == IFA_LABEL) {
*label = g_strdup ((char *) RTA_DATA (rt_attr));
@@ -347,17 +347,18 @@ is_wireless_status_message (struct nlmsghdr *header)
{
int rt_attr_len;
struct rtattr *rt_attr;
+ gboolean retval = FALSE;
rt_attr = IFLA_RTA (NLMSG_DATA (header));
rt_attr_len = IFLA_PAYLOAD (header);
while (RT_ATTR_OK (rt_attr, rt_attr_len)) {
if (rt_attr->rta_type == IFLA_WIRELESS)
- return TRUE;
+ return retval = TRUE;
rt_attr = RTA_NEXT (rt_attr, rt_attr_len);
}
- return FALSE;
+ return retval;
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]