You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "wengzhe (via GitHub)" <gi...@apache.org> on 2023/03/06 11:38:39 UTC
[GitHub] [nuttx] wengzhe commented on a diff in pull request #8739: net/arp: Only parse ioctl request for valid cmd.
wengzhe commented on code in PR #8739:
URL: https://github.com/apache/nuttx/pull/8739#discussion_r1126290034
##########
net/netdev/netdev_ioctl.c:
##########
@@ -1219,6 +1219,40 @@ static int netdev_imsf_ioctl(FAR struct socket *psock, int cmd,
}
#endif
+/****************************************************************************
+ * Name: ioctl_arpreq_parse
+ *
+ * Description:
+ * Parse arpreq into netdev and sockaddr.
+ *
+ * Input Parameters:
+ * req The argument of the ioctl cmd
+ * dev The pointer to get ethernet driver device structure
+ * addr The pointer to get address in the request
+ *
+ * Returned Value:
+ * true on success and false on failure.
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_NET_ARP
+static bool ioctl_arpreq_parse(FAR struct arpreq *req,
+ FAR struct net_driver_s **dev,
+ FAR struct sockaddr_in **addr)
+{
+ if (req != NULL)
+ {
+ *addr = (FAR struct sockaddr_in *)&req->arp_pa;
+ *dev = req->arp_dev[0] ?
Review Comment:
Done.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org