From 47aed25836f2d3b238e539b0c5859bb45c422afa Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 14 Jul 2017 11:35:26 -0600 Subject: [PATCH 1/3] Fixes to get apps/examples/udgram building again. --- netutils/netlib/netlib_getifstatus.c | 2 ++ netutils/netlib/netlib_setifstatus.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/netutils/netlib/netlib_getifstatus.c b/netutils/netlib/netlib_getifstatus.c index 2aab3d944..b6c241ea3 100644 --- a/netutils/netlib/netlib_getifstatus.c +++ b/netutils/netlib/netlib_getifstatus.c @@ -64,6 +64,8 @@ # define PF_INETX PF_INET #elif defined(CONFIG_NET_IPv6) # define PF_INETX PF_INET6 +#elif defined(CONFIG_NET_LOCAL) +# define PF_INETX PF_LOCAL #endif /**************************************************************************** diff --git a/netutils/netlib/netlib_setifstatus.c b/netutils/netlib/netlib_setifstatus.c index 5e4b775b2..1c0994e4c 100644 --- a/netutils/netlib/netlib_setifstatus.c +++ b/netutils/netlib/netlib_setifstatus.c @@ -63,6 +63,8 @@ # define PF_INETX PF_INET #elif defined(CONFIG_NET_IPv6) # define PF_INETX PF_INET6 +#elif defined(CONFIG_NET_LOCAL) +# define PF_INETX PF_LOCAL #endif /**************************************************************************** From 7441c5422fdce0efa95dd8fa6cc1370d27fb77b1 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 14 Jul 2017 13:43:04 -0600 Subject: [PATCH 2/3] Socket I/F: Cleanup for good CONFIG_NET_PKT build. --- netutils/netlib/netlib_getifstatus.c | 2 ++ netutils/netlib/netlib_getmacaddr.c | 4 +++- netutils/netlib/netlib_setifstatus.c | 2 ++ netutils/netlib/netlib_setmacaddr.c | 5 ++++- nshlib/nsh_netcmds.c | 7 +++++++ 5 files changed, 18 insertions(+), 2 deletions(-) diff --git a/netutils/netlib/netlib_getifstatus.c b/netutils/netlib/netlib_getifstatus.c index b6c241ea3..30af39e36 100644 --- a/netutils/netlib/netlib_getifstatus.c +++ b/netutils/netlib/netlib_getifstatus.c @@ -66,6 +66,8 @@ # define PF_INETX PF_INET6 #elif defined(CONFIG_NET_LOCAL) # define PF_INETX PF_LOCAL +#elif defined(CONFIG_NET_PKT) +# define PF_INETX PF_PACKET #endif /**************************************************************************** diff --git a/netutils/netlib/netlib_getmacaddr.c b/netutils/netlib/netlib_getmacaddr.c index 124ca6d6e..8c3c6c849 100644 --- a/netutils/netlib/netlib_getmacaddr.c +++ b/netutils/netlib/netlib_getmacaddr.c @@ -1,7 +1,7 @@ /**************************************************************************** * netutils/netlib/netlib_getmacaddr.c * - * Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -63,6 +63,8 @@ # define PF_INETX PF_INET #elif defined(CONFIG_NET_IPv6) # define PF_INETX PF_INET6 +#elif defined(CONFIG_NET_PKT) +# define PF_INETX PF_PACKET #endif /**************************************************************************** diff --git a/netutils/netlib/netlib_setifstatus.c b/netutils/netlib/netlib_setifstatus.c index 1c0994e4c..f15635a92 100644 --- a/netutils/netlib/netlib_setifstatus.c +++ b/netutils/netlib/netlib_setifstatus.c @@ -65,6 +65,8 @@ # define PF_INETX PF_INET6 #elif defined(CONFIG_NET_LOCAL) # define PF_INETX PF_LOCAL +#elif defined(CONFIG_NET_PKT) +# define PF_INETX PF_PACKET #endif /**************************************************************************** diff --git a/netutils/netlib/netlib_setmacaddr.c b/netutils/netlib/netlib_setmacaddr.c index d404c1af1..1545249f6 100644 --- a/netutils/netlib/netlib_setmacaddr.c +++ b/netutils/netlib/netlib_setmacaddr.c @@ -1,7 +1,7 @@ /**************************************************************************** * netutils/netlib/netlib_setmacaddr.c * - * Copyright (C) 2007-2009, 2011-2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011-2012, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -66,6 +66,9 @@ #elif defined(CONFIG_NET_IPv6) # define PF_INETX PF_INET6 # define AF_INETX AF_INET6 +#elif defined(CONFIG_NET_PKT) +# define PF_INETX PF_PACKET +# define AF_INETX AF_PACKET #endif /**************************************************************************** diff --git a/nshlib/nsh_netcmds.c b/nshlib/nsh_netcmds.c index 982173e1d..c2cc648f3 100644 --- a/nshlib/nsh_netcmds.c +++ b/nshlib/nsh_netcmds.c @@ -1096,6 +1096,13 @@ int cmd_ifconfig(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) } #endif +#if !defined(CONFIG_NET_IPv4) && !defined(CONFIG_NET_IPv6) + UNUSED(hostip); + UNUSED(mask); + UNUSED(gwip); + UNUSED(gip); +#endif + return OK; } #endif From 234afcd85ba602f71c5c3dc86041b1c7810ead97 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 14 Jul 2017 16:22:14 -0600 Subject: [PATCH 3/3] netutils/netlib: Fixes to work when only USRSOCK is enabled. --- netutils/netlib/netlib_getifstatus.c | 2 ++ netutils/netlib/netlib_getmacaddr.c | 2 ++ netutils/netlib/netlib_setifstatus.c | 2 ++ netutils/netlib/netlib_setmacaddr.c | 3 +++ 4 files changed, 9 insertions(+) diff --git a/netutils/netlib/netlib_getifstatus.c b/netutils/netlib/netlib_getifstatus.c index 30af39e36..2fdbeb853 100644 --- a/netutils/netlib/netlib_getifstatus.c +++ b/netutils/netlib/netlib_getifstatus.c @@ -68,6 +68,8 @@ # define PF_INETX PF_LOCAL #elif defined(CONFIG_NET_PKT) # define PF_INETX PF_PACKET +#elif defined(CONFIG_NET_USRSOCK) +# define PF_INETX PF_INET #endif /**************************************************************************** diff --git a/netutils/netlib/netlib_getmacaddr.c b/netutils/netlib/netlib_getmacaddr.c index 8c3c6c849..6f1fa5d26 100644 --- a/netutils/netlib/netlib_getmacaddr.c +++ b/netutils/netlib/netlib_getmacaddr.c @@ -65,6 +65,8 @@ # define PF_INETX PF_INET6 #elif defined(CONFIG_NET_PKT) # define PF_INETX PF_PACKET +#elif defined(CONFIG_NET_USRSOCK) +# define PF_INETX PF_INET #endif /**************************************************************************** diff --git a/netutils/netlib/netlib_setifstatus.c b/netutils/netlib/netlib_setifstatus.c index f15635a92..48c9ad4e5 100644 --- a/netutils/netlib/netlib_setifstatus.c +++ b/netutils/netlib/netlib_setifstatus.c @@ -67,6 +67,8 @@ # define PF_INETX PF_LOCAL #elif defined(CONFIG_NET_PKT) # define PF_INETX PF_PACKET +#elif defined(CONFIG_NET_USRSOCK) +# define PF_INETX PF_INET #endif /**************************************************************************** diff --git a/netutils/netlib/netlib_setmacaddr.c b/netutils/netlib/netlib_setmacaddr.c index 1545249f6..921e0847b 100644 --- a/netutils/netlib/netlib_setmacaddr.c +++ b/netutils/netlib/netlib_setmacaddr.c @@ -69,6 +69,9 @@ #elif defined(CONFIG_NET_PKT) # define PF_INETX PF_PACKET # define AF_INETX AF_PACKET +#elif defined(CONFIG_NET_USRSOCK) +# define PF_INETX PF_INET +# define AF_INETX AF_INET #endif /****************************************************************************