You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by pk...@apache.org on 2022/08/26 08:00:27 UTC

[incubator-nuttx] branch master updated (423ee67554 -> 77a99acc98)

This is an automated email from the ASF dual-hosted git repository.

pkarashchenko pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git


    from 423ee67554 Double the MMCSD_IDLE_DELAY from 50ms to 100ms because I found one card that needs this to work after initial CMD0.
     new 7c2986bb34 finetune the RA parsing procedure
     new 00cf3e559d update IPv6 NIC parameters unconditionally when ICMPv6 RA is received
     new cc421e43e4 icmpv6: add NTOHL when parse ICMPV6 option MTU
     new 77a99acc98 net/icmpv6: fix build break "duplicate macro parameter"

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 net/icmpv6/icmpv6.h         | 25 ++++++++++++++----
 net/icmpv6/icmpv6_input.c   | 64 ++++++++++++++++++++++++++++++---------------
 net/icmpv6/icmpv6_rnotify.c | 24 +++++------------
 3 files changed, 70 insertions(+), 43 deletions(-)


[incubator-nuttx] 01/04: finetune the RA parsing procedure

Posted by pk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pkarashchenko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 7c2986bb34f8334d5906a1bdefa02de7b00f3df0
Author: luojun1 <lu...@xiaomi.com>
AuthorDate: Thu Jul 28 21:53:58 2022 +0800

    finetune the RA parsing procedure
    
    Signed-off-by: luojun1 <lu...@xiaomi.com>
    Signed-off-by: chao.an <an...@xiaomi.com>
---
 net/icmpv6/icmpv6_input.c | 60 ++++++++++++++++++++++++++++++-----------------
 1 file changed, 39 insertions(+), 21 deletions(-)

diff --git a/net/icmpv6/icmpv6_input.c b/net/icmpv6/icmpv6_input.c
index 08272fe922..4684eb0f49 100644
--- a/net/icmpv6/icmpv6_input.c
+++ b/net/icmpv6/icmpv6_input.c
@@ -369,29 +369,47 @@ void icmpv6_input(FAR struct net_driver_s *dev, unsigned int iplen)
 
         for (ndx = 0; ndx + sizeof(struct icmpv6_prefixinfo_s) <= optlen; )
           {
-            FAR struct icmpv6_srclladdr_s *sllopt =
-              (FAR struct icmpv6_srclladdr_s *)&options[ndx];
+           FAR struct icmpv6_generic_s *opt =
+                                (FAR struct icmpv6_generic_s *)&options[ndx];
 
-            if (sllopt->opttype == ICMPv6_OPT_SRCLLADDR)
+            switch (opt->opttype)
               {
-                neighbor_add(dev, ipv6->srcipaddr, sllopt->srclladdr);
-              }
-
-            FAR struct icmpv6_prefixinfo_s *opt =
-              (FAR struct icmpv6_prefixinfo_s *)&options[ndx];
-
-            /* Is this the sought for prefix? Is it the correct size? Is
-             * the "A" flag set?
-             */
-
-            if (opt->opttype == ICMPv6_OPT_PREFIX &&
-               (opt->flags & ICMPv6_PRFX_FLAG_A) != 0)
-              {
-                /* Yes.. Notify any waiting threads */
-
-                icmpv6_rnotify(dev, ipv6->srcipaddr,
-                               opt->prefix, opt->preflen);
-                prefix = true;
+                case ICMPv6_OPT_SRCLLADDR:
+                  {
+                    FAR struct icmpv6_srclladdr_s *sllopt =
+                                      (FAR struct icmpv6_srclladdr_s *)opt;
+                    neighbor_add(dev, ipv6->srcipaddr, sllopt->srclladdr);
+                  }
+                  break;
+
+                case ICMPv6_OPT_PREFIX:
+                  {
+                    FAR struct icmpv6_prefixinfo_s *prefixopt =
+                                      (FAR struct icmpv6_prefixinfo_s *)opt;
+
+                    /* Is the "A" flag set? */
+
+                    if ((prefixopt->flags & ICMPv6_PRFX_FLAG_A) != 0)
+                      {
+                        /* Notify any waiting threads */
+
+                        icmpv6_rnotify(dev, ipv6->srcipaddr,
+                                    prefixopt->prefix, prefixopt->preflen);
+                        prefix = true;
+                      }
+                  }
+                  break;
+
+                case ICMPv6_OPT_MTU:
+                  {
+                    FAR struct icmpv6_mtu_s *mtuopt =
+                                        (FAR struct icmpv6_mtu_s *)opt;
+                    dev->d_pktsize = mtuopt->mtu;
+                  }
+                  break;
+
+                default:
+                  break;
               }
 
             /* Skip to the next option (units of octets) */


[incubator-nuttx] 04/04: net/icmpv6: fix build break "duplicate macro parameter"

Posted by pk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pkarashchenko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 77a99acc98737a9e38694fa8270de806b4087e53
Author: chao.an <an...@xiaomi.com>
AuthorDate: Fri Aug 26 14:11:48 2022 +0800

    net/icmpv6: fix build break "duplicate macro parameter"
    
    Error: net/icmpv6/icmpv6.h:442:33: error: duplicate macro parameter "d"
     #  define icmpv6_setaddresses(d,d,p,p) (0)
    
    Signed-off-by: chao.an <an...@xiaomi.com>
---
 net/icmpv6/icmpv6.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/icmpv6/icmpv6.h b/net/icmpv6/icmpv6.h
index 5b1b498afb..7821a8ca57 100644
--- a/net/icmpv6/icmpv6.h
+++ b/net/icmpv6/icmpv6.h
@@ -439,7 +439,7 @@ void icmpv6_setaddresses(FAR struct net_driver_s *dev,
                          const net_ipv6addr_t prefix,
                          unsigned int preflen);
 #else
-#  define icmpv6_setaddresses(d,d,p,p) (0)
+#  define icmpv6_setaddresses(dev,draddr,prefix,preflen) (0)
 #endif
 
 /****************************************************************************


[incubator-nuttx] 02/04: update IPv6 NIC parameters unconditionally when ICMPv6 RA is received

Posted by pk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pkarashchenko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 00cf3e559d367f16d93511ce272c0963285684c0
Author: luojun1 <lu...@xiaomi.com>
AuthorDate: Fri Jul 29 19:22:27 2022 +0800

    update IPv6 NIC parameters unconditionally when ICMPv6 RA is received
    
    Signed-off-by: luojun1 <lu...@xiaomi.com>
    Signed-off-by: chao.an <an...@xiaomi.com>
---
 net/icmpv6/icmpv6.h         | 25 ++++++++++++++++++++-----
 net/icmpv6/icmpv6_input.c   |  8 ++++++--
 net/icmpv6/icmpv6_rnotify.c | 24 +++++++-----------------
 3 files changed, 33 insertions(+), 24 deletions(-)

diff --git a/net/icmpv6/icmpv6.h b/net/icmpv6/icmpv6.h
index 1e3fbbe2e0..5b1b498afb 100644
--- a/net/icmpv6/icmpv6.h
+++ b/net/icmpv6/icmpv6.h
@@ -424,6 +424,24 @@ void icmpv6_notify(net_ipv6addr_t ipaddr);
 int icmpv6_autoconfig(FAR struct net_driver_s *dev);
 #endif
 
+/****************************************************************************
+ * Name: icmpv6_setaddresses
+ *
+ * Description:
+ *   We successfully obtained the Router Advertisement.  Set the new IPv6
+ *   addresses in the driver structure.
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_NET_ICMPv6_AUTOCONF
+void icmpv6_setaddresses(FAR struct net_driver_s *dev,
+                         const net_ipv6addr_t draddr,
+                         const net_ipv6addr_t prefix,
+                         unsigned int preflen);
+#else
+#  define icmpv6_setaddresses(d,d,p,p) (0)
+#endif
+
 /****************************************************************************
  * Name: icmpv6_rwait_setup
  *
@@ -502,12 +520,9 @@ int icmpv6_rwait(FAR struct icmpv6_rnotify_s *notify, unsigned int timeout);
  ****************************************************************************/
 
 #ifdef CONFIG_NET_ICMPv6_AUTOCONF
-void icmpv6_rnotify(FAR struct net_driver_s *dev,
-                    const net_ipv6addr_t draddr,
-                    const net_ipv6addr_t prefix,
-                    unsigned int preflen);
+void icmpv6_rnotify(FAR struct net_driver_s *dev);
 #else
-#  define icmpv6_rnotify(d,p,l)
+#  define icmpv6_rnotify(d) (0)
 #endif
 
 /****************************************************************************
diff --git a/net/icmpv6/icmpv6_input.c b/net/icmpv6/icmpv6_input.c
index 4684eb0f49..1408f1d82a 100644
--- a/net/icmpv6/icmpv6_input.c
+++ b/net/icmpv6/icmpv6_input.c
@@ -391,10 +391,14 @@ void icmpv6_input(FAR struct net_driver_s *dev, unsigned int iplen)
 
                     if ((prefixopt->flags & ICMPv6_PRFX_FLAG_A) != 0)
                       {
-                        /* Notify any waiting threads */
+                        /* Yes.. Set the new network addresses. */
 
-                        icmpv6_rnotify(dev, ipv6->srcipaddr,
+                        icmpv6_setaddresses(dev, ipv6->srcipaddr,
                                     prefixopt->prefix, prefixopt->preflen);
+
+                        /* Notify any waiting threads */
+
+                        icmpv6_rnotify(dev);
                         prefix = true;
                       }
                   }
diff --git a/net/icmpv6/icmpv6_rnotify.c b/net/icmpv6/icmpv6_rnotify.c
index 5c5c563a0b..392b83883f 100644
--- a/net/icmpv6/icmpv6_rnotify.c
+++ b/net/icmpv6/icmpv6_rnotify.c
@@ -58,22 +58,22 @@
 static struct icmpv6_rnotify_s *g_icmpv6_rwaiters;
 
 /****************************************************************************
- * Private Functions
+ * Public Functions
  ****************************************************************************/
 
 /****************************************************************************
  * Name: icmpv6_setaddresses
  *
  * Description:
- *   We successfully obtained the Router Advertisement.  See the new IPv6
+ *   We successfully obtained the Router Advertisement.  Set the new IPv6
  *   addresses in the driver structure.
  *
  ****************************************************************************/
 
-static void icmpv6_setaddresses(FAR struct net_driver_s *dev,
-                                const net_ipv6addr_t draddr,
-                                const net_ipv6addr_t prefix,
-                                unsigned int preflen)
+void icmpv6_setaddresses(FAR struct net_driver_s *dev,
+                         const net_ipv6addr_t draddr,
+                         const net_ipv6addr_t prefix,
+                         unsigned int preflen)
 {
   unsigned int i;
 
@@ -139,10 +139,6 @@ static void icmpv6_setaddresses(FAR struct net_driver_s *dev,
   net_unlock();
 }
 
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
 /****************************************************************************
  * Name: icmpv6_rwait_setup
  *
@@ -287,9 +283,7 @@ int icmpv6_rwait(FAR struct icmpv6_rnotify_s *notify, unsigned int timeout)
  *
  ****************************************************************************/
 
-void icmpv6_rnotify(FAR struct net_driver_s *dev,
-                    const net_ipv6addr_t draddr, const net_ipv6addr_t prefix,
-                    unsigned int preflen)
+void icmpv6_rnotify(FAR struct net_driver_s *dev)
 {
   FAR struct icmpv6_rnotify_s *curr;
 
@@ -307,10 +301,6 @@ void icmpv6_rnotify(FAR struct net_driver_s *dev,
       if (curr->rn_result != OK &&
           strncmp(curr->rn_ifname, dev->d_ifname, IFNAMSIZ) == 0)
         {
-          /* Yes.. Set the new network addresses. */
-
-          icmpv6_setaddresses(dev, draddr, prefix, preflen);
-
           /* And signal the waiting, returning success */
 
           curr->rn_result = OK;


[incubator-nuttx] 03/04: icmpv6: add NTOHL when parse ICMPV6 option MTU

Posted by pk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pkarashchenko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit cc421e43e4b7bb1b38dfe269a4dd1d029c2a1c8d
Author: zhanghongyu <zh...@xiaomi.com>
AuthorDate: Tue Aug 23 23:21:20 2022 +0800

    icmpv6: add NTOHL when parse ICMPV6 option MTU
    
    Signed-off-by: zhanghongyu <zh...@xiaomi.com>
    Signed-off-by: chao.an <an...@xiaomi.com>
---
 net/icmpv6/icmpv6_input.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/icmpv6/icmpv6_input.c b/net/icmpv6/icmpv6_input.c
index 1408f1d82a..62ef36068b 100644
--- a/net/icmpv6/icmpv6_input.c
+++ b/net/icmpv6/icmpv6_input.c
@@ -408,7 +408,7 @@ void icmpv6_input(FAR struct net_driver_s *dev, unsigned int iplen)
                   {
                     FAR struct icmpv6_mtu_s *mtuopt =
                                         (FAR struct icmpv6_mtu_s *)opt;
-                    dev->d_pktsize = mtuopt->mtu;
+                    dev->d_pktsize = NTOHL(mtuopt->mtu);
                   }
                   break;