You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/02/19 03:58:06 UTC

[GitHub] [incubator-nuttx] yamt opened a new pull request #2869: netdb.h: Add NI_MAXHOST and NI_MAXSERV

yamt opened a new pull request #2869:
URL: https://github.com/apache/incubator-nuttx/pull/2869


   ## Summary
   
   netdb.h: Add NI_MAXHOST and NI_MAXSERV
   
   * These are not parts of the standards as far as I know.
   * These are provided by many platforms. (GLIBC, BSD, Windows, etc)
   * These are convenient.
   
   ## Impact
   
   ## Testing
   
   tested with my local app.
   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #2869: netdb.h: Add NI_MAXHOST and NI_MAXSERV

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #2869:
URL: https://github.com/apache/incubator-nuttx/pull/2869#discussion_r579083840



##########
File path: include/netdb.h
##########
@@ -156,6 +156,28 @@
 #define NO_RECOVERY    3
 #define TRY_AGAIN      4
 
+/* NI_MAXHOST is the max of
+ *
+ *    CONFIG_NETDB_DNSCLIENT_NAMESIZE + 1
+ *    INET6_ADDRSTRLEN
+ *    INET_ADDRSTRLEN
+ *
+ * Note: INETxxx_ADDRSTRLEN already includes the terminating NUL.
+ * Note: INET6_ADDRSTRLEN > INET_ADDRSTRLEN is assumed.
+ */
+
+#if CONFIG_NETDB_DNSCLIENT_NAMESIZE > INET6_ADDRSTRLEN
+#define	NI_MAXHOST	CONFIG_NETDB_DNSCLIENT_NAMESIZE
+#else
+#define	NI_MAXHOST	INET6_ADDRSTRLEN

Review comment:
       should we check CONFIG_NET_IPv6 and CONFIG_NET_IPv4 here? And should we replace CONFIG_NETDB_DNSCLIENT_NAMESIZE in source code with NI_MAXHOST? since NI_MAXHOST may different from 
    CONFIG_NETDB_DNSCLIENT_NAMESIZE.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #2869: netdb.h: Add NI_MAXHOST and NI_MAXSERV

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #2869:
URL: https://github.com/apache/incubator-nuttx/pull/2869#discussion_r579083840



##########
File path: include/netdb.h
##########
@@ -156,6 +156,28 @@
 #define NO_RECOVERY    3
 #define TRY_AGAIN      4
 
+/* NI_MAXHOST is the max of
+ *
+ *    CONFIG_NETDB_DNSCLIENT_NAMESIZE + 1
+ *    INET6_ADDRSTRLEN
+ *    INET_ADDRSTRLEN
+ *
+ * Note: INETxxx_ADDRSTRLEN already includes the terminating NUL.
+ * Note: INET6_ADDRSTRLEN > INET_ADDRSTRLEN is assumed.
+ */
+
+#if CONFIG_NETDB_DNSCLIENT_NAMESIZE > INET6_ADDRSTRLEN
+#define	NI_MAXHOST	CONFIG_NETDB_DNSCLIENT_NAMESIZE
+#else
+#define	NI_MAXHOST	INET6_ADDRSTRLEN

Review comment:
       should we check CONFIG_NET_IPv6 and CONFIG_NET_IPv4 here? And should we replace CONFIG_NETDB_DNSCLIENT_NAMESIZE in source code with NI_MAXHOST? since NI_MAXHOST may different from CONFIG_NETDB_DNSCLIENT_NAMESIZE.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] yamt commented on a change in pull request #2869: netdb.h: Add NI_MAXHOST and NI_MAXSERV

Posted by GitBox <gi...@apache.org>.
yamt commented on a change in pull request #2869:
URL: https://github.com/apache/incubator-nuttx/pull/2869#discussion_r579253664



##########
File path: include/netdb.h
##########
@@ -156,6 +156,28 @@
 #define NO_RECOVERY    3
 #define TRY_AGAIN      4
 
+/* NI_MAXHOST is the max of
+ *
+ *    CONFIG_NETDB_DNSCLIENT_NAMESIZE + 1
+ *    INET6_ADDRSTRLEN
+ *    INET_ADDRSTRLEN
+ *
+ * Note: INETxxx_ADDRSTRLEN already includes the terminating NUL.
+ * Note: INET6_ADDRSTRLEN > INET_ADDRSTRLEN is assumed.
+ */
+
+#if CONFIG_NETDB_DNSCLIENT_NAMESIZE > INET6_ADDRSTRLEN
+#define	NI_MAXHOST	CONFIG_NETDB_DNSCLIENT_NAMESIZE
+#else
+#define	NI_MAXHOST	INET6_ADDRSTRLEN

Review comment:
       > should we check CONFIG_NET_IPv6 and CONFIG_NET_IPv4 here?
   
   maybe.
   
   > And should we replace CONFIG_NETDB_DNSCLIENT_NAMESIZE in source code with NI_MAXHOST? since NI_MAXHOST may different from CONFIG_NETDB_DNSCLIENT_NAMESIZE.
   
   it depends.
   




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 merged pull request #2869: netdb.h: Add NI_MAXHOST and NI_MAXSERV

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged pull request #2869:
URL: https://github.com/apache/incubator-nuttx/pull/2869


   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #2869: netdb.h: Add NI_MAXHOST and NI_MAXSERV

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #2869:
URL: https://github.com/apache/incubator-nuttx/pull/2869#discussion_r579083840



##########
File path: include/netdb.h
##########
@@ -156,6 +156,28 @@
 #define NO_RECOVERY    3
 #define TRY_AGAIN      4
 
+/* NI_MAXHOST is the max of
+ *
+ *    CONFIG_NETDB_DNSCLIENT_NAMESIZE + 1
+ *    INET6_ADDRSTRLEN
+ *    INET_ADDRSTRLEN
+ *
+ * Note: INETxxx_ADDRSTRLEN already includes the terminating NUL.
+ * Note: INET6_ADDRSTRLEN > INET_ADDRSTRLEN is assumed.
+ */
+
+#if CONFIG_NETDB_DNSCLIENT_NAMESIZE > INET6_ADDRSTRLEN
+#define	NI_MAXHOST	CONFIG_NETDB_DNSCLIENT_NAMESIZE
+#else
+#define	NI_MAXHOST	INET6_ADDRSTRLEN

Review comment:
       should we check CONFIG_NET_IPv6 and CONFIG_NET_IPv4 here? And should we replace CONFIG_NETDB_DNSCLIENT_NAMESIZE in source code with NI_MAXHOST? since NI_MAXHOST may different from 
   CONFIG_NETDB_DNSCLIENT_NAMESIZE.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #2869: netdb.h: Add NI_MAXHOST and NI_MAXSERV

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #2869:
URL: https://github.com/apache/incubator-nuttx/pull/2869#discussion_r579083840



##########
File path: include/netdb.h
##########
@@ -156,6 +156,28 @@
 #define NO_RECOVERY    3
 #define TRY_AGAIN      4
 
+/* NI_MAXHOST is the max of
+ *
+ *    CONFIG_NETDB_DNSCLIENT_NAMESIZE + 1
+ *    INET6_ADDRSTRLEN
+ *    INET_ADDRSTRLEN
+ *
+ * Note: INETxxx_ADDRSTRLEN already includes the terminating NUL.
+ * Note: INET6_ADDRSTRLEN > INET_ADDRSTRLEN is assumed.
+ */
+
+#if CONFIG_NETDB_DNSCLIENT_NAMESIZE > INET6_ADDRSTRLEN
+#define	NI_MAXHOST	CONFIG_NETDB_DNSCLIENT_NAMESIZE
+#else
+#define	NI_MAXHOST	INET6_ADDRSTRLEN

Review comment:
       should we check CONFIG_NET_IPv6 and CONFIG_NET_IPv4 here?




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] yamt commented on a change in pull request #2869: netdb.h: Add NI_MAXHOST and NI_MAXSERV

Posted by GitBox <gi...@apache.org>.
yamt commented on a change in pull request #2869:
URL: https://github.com/apache/incubator-nuttx/pull/2869#discussion_r579260425



##########
File path: include/netdb.h
##########
@@ -156,6 +156,28 @@
 #define NO_RECOVERY    3
 #define TRY_AGAIN      4
 
+/* NI_MAXHOST is the max of
+ *
+ *    CONFIG_NETDB_DNSCLIENT_NAMESIZE + 1
+ *    INET6_ADDRSTRLEN
+ *    INET_ADDRSTRLEN
+ *
+ * Note: INETxxx_ADDRSTRLEN already includes the terminating NUL.
+ * Note: INET6_ADDRSTRLEN > INET_ADDRSTRLEN is assumed.
+ */
+
+#if CONFIG_NETDB_DNSCLIENT_NAMESIZE > INET6_ADDRSTRLEN
+#define	NI_MAXHOST	CONFIG_NETDB_DNSCLIENT_NAMESIZE
+#else
+#define	NI_MAXHOST	INET6_ADDRSTRLEN

Review comment:
       i fixed config checks here




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org