@@ -454,7 +454,7 @@ inline static int router_compare_pio_addr(const struct ra_pio *pio, const struct
454454{
455455 uint8_t cmp_len = max (64 , max (pio -> length , addr -> prefix_len ));
456456
457- return odhcpd_bmemcmp (& pio -> prefix , & addr -> addr .in6 , cmp_len );
457+ return odhcpd_bmemcmp (& pio -> addr , & addr -> addr .in6 , cmp_len );
458458}
459459
460460static struct ra_pio * router_find_ra_pio (struct interface * iface ,
@@ -478,20 +478,20 @@ static void router_add_ra_pio(struct interface *iface,
478478
479479 pio = router_find_ra_pio (iface , addr );
480480 if (pio ) {
481- if (memcmp (& pio -> prefix , & addr -> addr .in6 , sizeof (struct in6_addr )) != 0 ||
481+ if (memcmp (& pio -> addr , & addr -> addr .in6 , sizeof (struct in6_addr )) != 0 ||
482482 pio -> length != addr -> prefix_len )
483483 {
484484 char new_ipv6_str [INET6_ADDRSTRLEN ];
485485
486486 iface -> pio_update = true;
487487 warn ("rfc9096: %s: changed %s/%u -> %s/%u" ,
488488 iface -> ifname ,
489- inet_ntop (AF_INET6 , & pio -> prefix , ipv6_str , sizeof (ipv6_str )),
489+ inet_ntop (AF_INET6 , & pio -> addr , ipv6_str , sizeof (ipv6_str )),
490490 pio -> length ,
491491 inet_ntop (AF_INET6 , & addr -> addr .in6 , new_ipv6_str , sizeof (new_ipv6_str )),
492492 addr -> prefix_len );
493493
494- memcpy (& pio -> prefix , & addr -> addr .in6 , sizeof (struct in6_addr ));
494+ memcpy (& pio -> addr , & addr -> addr .in6 , sizeof (struct in6_addr ));
495495 pio -> length = addr -> prefix_len ;
496496 }
497497
@@ -501,7 +501,7 @@ static void router_add_ra_pio(struct interface *iface,
501501 iface -> pio_update = true;
502502 warn ("rfc9096: %s: renew %s/%u" ,
503503 iface -> ifname ,
504- inet_ntop (AF_INET6 , & pio -> prefix , ipv6_str , sizeof (ipv6_str )),
504+ inet_ntop (AF_INET6 , & pio -> addr , ipv6_str , sizeof (ipv6_str )),
505505 pio -> length );
506506 }
507507
@@ -516,14 +516,14 @@ static void router_add_ra_pio(struct interface *iface,
516516 pio = & iface -> pios [iface -> pio_cnt ];
517517 iface -> pio_cnt ++ ;
518518
519- memcpy (& pio -> prefix , & addr -> addr .in6 , sizeof (struct in6_addr ));
519+ memcpy (& pio -> addr , & addr -> addr .in6 , sizeof (struct in6_addr ));
520520 pio -> length = addr -> prefix_len ;
521521 pio -> lifetime = 0 ;
522522
523523 iface -> pio_update = true;
524524 info ("rfc9096: %s: add %s/%u" ,
525525 iface -> ifname ,
526- inet_ntop (AF_INET6 , & pio -> prefix , ipv6_str , sizeof (ipv6_str )),
526+ inet_ntop (AF_INET6 , & pio -> addr , ipv6_str , sizeof (ipv6_str )),
527527 pio -> length );
528528}
529529
@@ -540,10 +540,10 @@ static void router_clear_duplicated_ra_pio(struct interface *iface)
540540 struct ra_pio * pio_b = & iface -> pios [j ];
541541
542542 if (pio_a -> length == pio_b -> length &&
543- !memcmp (& pio_a -> prefix , & pio_b -> prefix , sizeof (struct in6_addr ))) {
543+ !memcmp (& pio_a -> addr , & pio_b -> addr , sizeof (struct in6_addr ))) {
544544 warn ("rfc9096: %s: clear duplicated %s/%u" ,
545545 iface -> ifname ,
546- inet_ntop (AF_INET6 , & pio_a -> prefix , ipv6_str , sizeof (ipv6_str )),
546+ inet_ntop (AF_INET6 , & pio_a -> addr , ipv6_str , sizeof (ipv6_str )),
547547 pio_a -> length );
548548
549549 iface -> pios [j ] = iface -> pios [iface -> pio_cnt - 1 ];
@@ -574,7 +574,7 @@ static void router_clear_expired_ra_pio(time_t now,
574574 if (ra_pio_expired (cur_pio , now )) {
575575 info ("rfc9096: %s: clear expired %s/%u" ,
576576 iface -> ifname ,
577- inet_ntop (AF_INET6 , & cur_pio -> prefix , ipv6_str , sizeof (ipv6_str )),
577+ inet_ntop (AF_INET6 , & cur_pio -> addr , ipv6_str , sizeof (ipv6_str )),
578578 cur_pio -> length );
579579
580580 iface -> pios [i ] = iface -> pios [iface -> pio_cnt - 1 ];
@@ -610,7 +610,7 @@ static void router_stale_ra_pio(struct interface *iface,
610610 iface -> pio_update = true;
611611 warn ("rfc9096: %s: stale %s/%u" ,
612612 iface -> ifname ,
613- inet_ntop (AF_INET6 , & pio -> prefix , ipv6_str , sizeof (ipv6_str )),
613+ inet_ntop (AF_INET6 , & pio -> addr , ipv6_str , sizeof (ipv6_str )),
614614 pio -> length );
615615}
616616
@@ -725,7 +725,7 @@ static int send_router_advert(struct interface *iface, const struct in6_addr *fr
725725 if (!pio_found ) {
726726 struct odhcpd_ipaddr * addr = & addrs [total_addr_cnt ];
727727
728- memcpy (& addr -> addr .in6 , & cur_pio -> prefix , sizeof (addr -> addr .in6 ));
728+ memcpy (& addr -> addr .in6 , & cur_pio -> addr , sizeof (addr -> addr .in6 ));
729729 addr -> prefix_len = cur_pio -> length ;
730730 addr -> preferred_lt = 0 ;
731731 addr -> valid_lt = (uint32_t ) (now + ND_VALID_LIMIT );
0 commit comments