summaryrefslogtreecommitdiff
path: root/src/inet.c
diff options
context:
space:
mode:
authorJukka Rissanen <jukka.rissanen@linux.intel.com>2012-01-05 11:38:06 (GMT)
committerDaniel Wagner <daniel.wagner@bmw-carit.de>2012-01-05 12:17:26 (GMT)
commit931367f3c9574b7fc473fdce23627f4108cfb90d (patch)
tree90c62e5e7f979206d0501d44cbf865816d4a3e37 /src/inet.c
parent19e8effd134678d9467e328090717b10cef0c208 (diff)
downloadconnman-931367f3c9574b7fc473fdce23627f4108cfb90d.zip
connman-931367f3c9574b7fc473fdce23627f4108cfb90d.tar.gz
connman-931367f3c9574b7fc473fdce23627f4108cfb90d.tar.bz2
inet: Return router advertisement packet length in callback.
The length of the RA packet must be returned in callback, otherwise callback cannot check RA options. The prefix length RA option is needed in stateful DHCPv6 implementation.
Diffstat (limited to 'src/inet.c')
-rw-r--r--src/inet.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/inet.c b/src/inet.c
index a2a66da..a659ab0 100644
--- a/src/inet.c
+++ b/src/inet.c
@@ -1456,7 +1456,7 @@ static gboolean rs_timeout_cb(gpointer user_data)
return FALSE;
if (data->callback != NULL)
- data->callback(NULL, data->user_data);
+ data->callback(NULL, 0, data->user_data);
data->rs_timeout = 0;
rs_cleanup(data);
@@ -1488,16 +1488,18 @@ static int icmpv6_recv(int fd, gpointer user_data)
len = recvmsg(fd, &mhdr, 0);
if (len < 0) {
- data->callback(NULL, data->user_data);
+ data->callback(NULL, 0, data->user_data);
rs_cleanup(data);
return -errno;
}
hdr = (struct nd_router_advert *)buf;
+ DBG("code %d len %zd hdr %zd", hdr->nd_ra_code, len,
+ sizeof(struct nd_router_advert));
if (hdr->nd_ra_code != 0)
return 0;
- data->callback(hdr, data->user_data);
+ data->callback(hdr, len, data->user_data);
rs_cleanup(data);
return len;