diff --git a/net/net_delroute.c b/net/net_delroute.c index e10dbfd48f..50c978a88d 100644 --- a/net/net_delroute.c +++ b/net/net_delroute.c @@ -87,7 +87,7 @@ static int net_match(FAR struct net_route_s *route, FAR void *arg) */ if (uip_ipaddr_maskcmp(route->target, match->target, match->netmask) && - uip_ipaddr_cmp(route->target, match->netmask)) + uip_ipaddr_cmp(route->netmask, match->netmask)) { /* They match.. Remove the entry from the routing table */ diff --git a/net/netdev_ioctl.c b/net/netdev_ioctl.c index 25961a8127..ff94ed5c29 100644 --- a/net/netdev_ioctl.c +++ b/net/netdev_ioctl.c @@ -645,16 +645,16 @@ static int netdev_rtioctl(FAR struct socket *psock, int cmd, } #ifdef CONFIG_NET_IPv6 - addr = (FAR struct sockaddr_in6 *)&rtentry->rt_target; + addr = (FAR struct sockaddr_in6 *)rtentry->rt_target; target = (uip_ipaddr_t)addr->sin6_addr.u6_addr16; - addr = (FAR struct sockaddr_in6 *)&rtentry->rt_netmask; + addr = (FAR struct sockaddr_in6 *)rtentry->rt_netmask; netmask = (uip_ipaddr_t)addr->sin6_addr.u6_addr16; #else - addr = (FAR struct sockaddr_in *)&rtentry->rt_target; + addr = (FAR struct sockaddr_in *)rtentry->rt_target; target = (uip_ipaddr_t)addr->sin_addr.s_addr; - addr = (FAR struct sockaddr_in *)&rtentry->rt_netmask; + addr = (FAR struct sockaddr_in *)rtentry->rt_netmask; netmask = (uip_ipaddr_t)addr->sin_addr.s_addr; #endif ret = net_delroute(target, netmask);