On Wed, Nov 16, 2016 at 5:25 AM, Thadeu Lima de Souza Cascardo <casca...@redhat.com> wrote: > On Tue, Nov 15, 2016 at 09:15:26PM -0800, Pravin B Shelar wrote: >> Following warning was reported by Travis:- >> >> lib/netdev.c:1916:19: error: cast from 'struct sockaddr *' to 'struct >> sockaddr_in *' increases required alignment from 2 to 4 >> [-Werror,-Wcast-align] >> sin = (struct sockaddr_in *) ifa->ifa_netmask; >> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> lib/netdev.c:1924:20: error: cast from 'struct sockaddr *' to 'struct >> sockaddr_in6 *' increases required alignment from 2 to 4 >> [-Werror,-Wcast-align] >> sin6 = (struct sockaddr_in6 *) ifa->ifa_netmask; >> >> Fixes: 3f31aded6 ("netdev: fix netmask in netdev_get_addrs"). >> Signed-off-by: Pravin B Shelar <pshe...@ovn.org> >> --- >> lib/netdev.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/lib/netdev.c b/lib/netdev.c >> index ad90ef6..ee9b461 100644 >> --- a/lib/netdev.c >> +++ b/lib/netdev.c >> @@ -1913,7 +1913,7 @@ netdev_get_addrs(const char dev[], struct in6_addr >> **paddr, >> >> sin = ALIGNED_CAST(const struct sockaddr_in *, ifa->ifa_addr); >> in6_addr_set_mapped_ipv4(&addr_array[i], sin->sin_addr.s_addr); >> - sin = (struct sockaddr_in *) ifa->ifa_netmask; >> + sin = ALIGNED_CAST(const struct sockaddr_in *, >> ifa->ifa_netmask); >> in6_addr_set_mapped_ipv4(&mask_array[i], sin->sin_addr.s_addr); >> i++; >> } else if (family == AF_INET6) { >> @@ -1921,7 +1921,7 @@ netdev_get_addrs(const char dev[], struct in6_addr >> **paddr, >> >> sin6 = ALIGNED_CAST(const struct sockaddr_in6 *, ifa->ifa_addr); >> memcpy(&addr_array[i], &sin6->sin6_addr, sizeof *addr_array); >> - sin6 = (struct sockaddr_in6 *) ifa->ifa_netmask; >> + sin6 = ALIGNED_CAST(const struct sockaddr_in6 *, >> ifa->ifa_netmask); >> memcpy(&mask_array[i], &sin6->sin6_addr, sizeof *mask_array); >> i++; >> } >> -- >> 1.8.3.1 >> >> _______________________________________________ >> dev mailing list >> d...@openvswitch.org >> https://mail.openvswitch.org/mailman/listinfo/ovs-dev > > Daniele sent the same patch. > I did not realized it yesterday. anyways since it is trivial patch I pushed this acked patch.
> Acked-by: Thadeu Lima de Souza Cascardo <casca...@redhat.com> _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev