]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix warnings on Linux
authorRoy Marples <roy@marples.name>
Thu, 15 Dec 2011 03:22:47 +0000 (03:22 +0000)
committerRoy Marples <roy@marples.name>
Thu, 15 Dec 2011 03:22:47 +0000 (03:22 +0000)
ipv6rs.c

index 931c24cde9837065f05f21effbbea1d61f034b46..02490ed5dd6a15aa3987f30cae7cac4954e0e3d6 100644 (file)
--- a/ipv6rs.c
+++ b/ipv6rs.c
@@ -259,7 +259,7 @@ ipv6rs_handledata(_unused void *arg)
        struct icmp6_hdr *icp;
        struct interface *ifp;
        const char *sfrom;
-       struct nd_router_advert *radvert;
+       struct nd_router_advert *nd_ra;
        struct nd_opt_prefix_info *pi;
        struct nd_opt_mtu *mtu;
        struct nd_opt_rdnss *rdnss;
@@ -338,7 +338,6 @@ ipv6rs_handledata(_unused void *arg)
 
        syslog(LOG_INFO, "%s: Router Advertisement from %s", ifp->name, sfrom);
        delete_timeouts(ifp, NULL);
-       radvert = (struct nd_router_advert *)icp;
 
        for (rap = ifp->ras; rap; rap = rap->next) {
                if (memcmp(rap->from.s6_addr, from.sin6_addr.s6_addr,
@@ -356,7 +355,8 @@ ipv6rs_handledata(_unused void *arg)
        }
 
        get_monotonic(&rap->received);
-       rap->lifetime = ntohl(icp->icmp6_dataun.icmp6_un_data32);
+       nd_ra = (struct nd_router_advert *)icp;
+       rap->lifetime = ntohs(nd_ra->nd_ra_router_lifetime);
 
        len -= sizeof(struct nd_router_advert);
        p = ((uint8_t *)icp) + sizeof(struct nd_router_advert);