diff --git a/net/devif/devif_poll.c b/net/devif/devif_poll.c index 2caf2d58a0f..4fb74ff36b1 100644 --- a/net/devif/devif_poll.c +++ b/net/devif/devif_poll.c @@ -369,7 +369,8 @@ static inline int devif_poll_icmpv6(FAR struct net_driver_s *dev, { /* Perform the ICMPV6 poll * Note: conn equal NULL in the first iteration means poll dev's callback list - * since icmpv6_neighbor still append it's callback into this list. + * since icmpv6_autoconfig and icmpv6_neighbor still append it's callback into + * this list. */ icmpv6_poll(dev, conn); diff --git a/net/icmpv6/icmpv6.h b/net/icmpv6/icmpv6.h index 1a9feaf521b..189249ca009 100644 --- a/net/icmpv6/icmpv6.h +++ b/net/icmpv6/icmpv6.h @@ -421,7 +421,6 @@ void icmpv6_notify(net_ipv6addr_t ipaddr); * * Input Parameters: * dev - The device driver structure to assign the address to - * psock - A pointer to a NuttX-specific, internal socket structure * * Returned Value: * Zero (OK) is returned on success; A negated errno value is returned on @@ -430,8 +429,7 @@ void icmpv6_notify(net_ipv6addr_t ipaddr); ****************************************************************************/ #ifdef CONFIG_NET_ICMPv6_AUTOCONF -int icmpv6_autoconfig(FAR struct net_driver_s *dev, - FAR struct socket *psock); +int icmpv6_autoconfig(FAR struct net_driver_s *dev); #endif /**************************************************************************** diff --git a/net/icmpv6/icmpv6_autoconfig.c b/net/icmpv6/icmpv6_autoconfig.c index f104972f849..12ad47b2f59 100644 --- a/net/icmpv6/icmpv6_autoconfig.c +++ b/net/icmpv6/icmpv6_autoconfig.c @@ -186,7 +186,6 @@ static uint16_t icmpv6_router_eventhandler(FAR struct net_driver_s *dev, * * Input Parameters: * dev - The device to use to send the solicitation - * conn - A pointer to the ICMPv6 connection structure * advertise - True: Send the Neighbor Advertisement message * * Returned Value: @@ -198,9 +197,7 @@ static uint16_t icmpv6_router_eventhandler(FAR struct net_driver_s *dev, * ****************************************************************************/ -static int icmpv6_send_message(FAR struct net_driver_s *dev, - FAR struct icmpv6_conn_s *conn, - bool advertise) +static int icmpv6_send_message(FAR struct net_driver_s *dev, bool advertise) { struct icmpv6_router_s state; int ret; @@ -225,7 +222,7 @@ static int icmpv6_send_message(FAR struct net_driver_s *dev, * want anything to happen until we are ready. */ - state.snd_cb = icmpv6_callback_alloc(dev, conn); + state.snd_cb = devif_callback_alloc(dev, &dev->d_conncb); if (!state.snd_cb) { nerr("ERROR: Failed to allocate a cllback\n"); @@ -257,7 +254,7 @@ static int icmpv6_send_message(FAR struct net_driver_s *dev, while (!state.snd_sent); ret = state.snd_result; - icmpv6_callback_free(dev, conn, state.snd_cb); + devif_dev_callback_free(dev, state.snd_cb); errout_with_semaphore: nxsem_destroy(&state.snd_sem); @@ -293,9 +290,8 @@ errout_with_semaphore: * ****************************************************************************/ -int icmpv6_autoconfig(FAR struct net_driver_s *dev, FAR struct socket *psock) +int icmpv6_autoconfig(FAR struct net_driver_s *dev) { - FAR struct icmpv6_conn_s *conn = psock->s_conn; struct icmpv6_rnotify_s notify; struct timespec delay; net_ipv6addr_t lladdr; @@ -400,7 +396,7 @@ int icmpv6_autoconfig(FAR struct net_driver_s *dev, FAR struct socket *psock) /* Send the ICMPv6 Router solicitation message */ - ret = icmpv6_send_message(dev, conn, false); + ret = icmpv6_send_message(dev, false); if (ret < 0) { nerr("ERROR: Failed send router solicitation: %d\n", ret); @@ -436,7 +432,7 @@ int icmpv6_autoconfig(FAR struct net_driver_s *dev, FAR struct socket *psock) * Advertisement message. */ - ret = icmpv6_send_message(dev, conn, true); + ret = icmpv6_send_message(dev, true); if (ret < 0) { nerr("ERROR: Failed send neighbor advertisement: %d\n", ret); diff --git a/net/netdev/netdev_ioctl.c b/net/netdev/netdev_ioctl.c index 8f597621d04..6b1c4a7b9f6 100644 --- a/net/netdev/netdev_ioctl.c +++ b/net/netdev/netdev_ioctl.c @@ -897,7 +897,7 @@ static int netdev_ifr_ioctl(FAR struct socket *psock, int cmd, dev = netdev_ifr_dev(req); if (dev) { - ret = icmpv6_autoconfig(dev, psock); + ret = icmpv6_autoconfig(dev); } } break;