lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Message-ID: <Y+4rd1q58XzLlCOy@lunn.ch> Date: Thu, 16 Feb 2023 14:11:19 +0100 From: Andrew Lunn <andrew@...n.ch> To: Mengyuan Lou <mengyuanlou@...-swift.com> Cc: netdev@...r.kernel.org, jiawenwu@...stnetic.com Subject: Re: [PATCH net-next] net: wangxun: Implement the ndo change mtu interface > +static int ngbe_change_mtu(struct net_device *netdev, int new_mtu) > +{ > + int max_frame = new_mtu + ETH_HLEN + ETH_FCS_LEN; > + struct wx *wx = netdev_priv(netdev); > + > + if (max_frame > WX_MAX_JUMBO_FRAME_SIZE) > + return -EINVAL; You set netdev->max_mtu. So was it possible to actually make this happen? > + > + netdev_info(netdev, "Changing MTU from %d to %d.\n", > + netdev->mtu, new_mtu); netdev_dbg(). > +static void txgbe_reinit_locked(struct wx *wx) > +{ > + /* prevent tx timeout */ > + netif_trans_update(wx->netdev); > + txgbe_down(wx); > + wx_configure(wx); > + txgbe_up_complete(wx); > +} None of these can fail? None allocate memory, etc? > +static int txgbe_change_mtu(struct net_device *netdev, int new_mtu) > +{ > + int max_frame = new_mtu + ETH_HLEN + ETH_FCS_LEN; > + struct wx *wx = netdev_priv(netdev); > + > + if (max_frame > WX_MAX_JUMBO_FRAME_SIZE) > + return -EINVAL; > + > + netdev_info(netdev, "Changing MTU from %d to %d.\n", > + netdev->mtu, new_mtu); Same two comments as above. Andrew
Powered by blists - more mailing lists