You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2023/08/09 10:29:33 UTC

[nuttx] branch master updated: net/netdev: Simplify handling of SIOCSIFMTU

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

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


The following commit(s) were added to refs/heads/master by this push:
     new c2ba0dfd6c net/netdev: Simplify handling of SIOCSIFMTU
c2ba0dfd6c is described below

commit c2ba0dfd6c0bdb1e3950339fc439e21f8d366d38
Author: Zhe Weng <we...@xiaomi.com>
AuthorDate: Mon Aug 7 10:07:53 2023 +0800

    net/netdev: Simplify handling of SIOCSIFMTU
    
    The call of netdev_ifr_dev is already simplified by commit fd53db56b6
    
    Signed-off-by: Zhe Weng <we...@xiaomi.com>
---
 net/netdev/netdev_ioctl.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/net/netdev/netdev_ioctl.c b/net/netdev/netdev_ioctl.c
index 1a88d14c5d..98d76d87ca 100644
--- a/net/netdev/netdev_ioctl.c
+++ b/net/netdev/netdev_ioctl.c
@@ -927,11 +927,7 @@ static int netdev_ifr_ioctl(FAR struct socket *psock, int cmd,
         req->ifr_mtu = NETDEV_PKTSIZE(dev) - dev->d_llhdrlen;
         break;
       case SIOCSIFMTU:   /* Set MTU size */
-        dev = netdev_ifr_dev(req);
-        if (dev)
-          {
-            NETDEV_PKTSIZE(dev) = req->ifr_mtu + dev->d_llhdrlen;
-          }
+        NETDEV_PKTSIZE(dev) = req->ifr_mtu + dev->d_llhdrlen;
         break;
 
 #ifdef CONFIG_NET_ICMPv6_AUTOCONF