Skip to contentSkip to conversation

net: lapbether: Close the LAPB device before its underlying Ethernet device closes

PATCH Applied Xie He 2 participants 2 messages Mar 18, 2021 – Mar 19, 2021

Subsystems (3)
lore
Share & tools
lore

Xie He

author
#0 lore raw

PATCH 1/1 net: lapbether: Close the LAPB device before its underlying Ethernet device closes

When a virtual LAPB device's underlying Ethernet device closes, the LAPB device is also closed.

However, currently the LAPB device is closed after the Ethernet device closes. It would be better to close it before the Ethernet device closes. This would allow the LAPB device to transmit a last frame to notify the other side that it is disconnecting.

---
 drivers/net/wan/lapbether.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wan/lapbether.c +2 -2
index 8fda0446ff71..45d74285265a 100644
@@ -421,8 +421,8 @@ static int lapbeth_device_event(struct notifier_block *this,
 		if (lapbeth_get_x25_dev(dev) == NULL)
 			lapbeth_new_device(dev);
 		break;
-	case NETDEV_DOWN:	
-		/* ethernet device closed -> close LAPB interface */
+	case NETDEV_GOING_DOWN:
+		/* ethernet device closes -> close LAPB interface */
 		lapbeth = lapbeth_get_x25_dev(dev);
 		if (lapbeth) 
 			dev_close(lapbeth->axdev);
Signature · 1 line
2.27.0
#1 lore raw
This patch was applied to netdev/net-next.git (refs/heads/master):

Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

Quoted 9 lines · On Thu, 18 Mar 2021 12:07:47 -0700 you wrote:

When a virtual LAPB device's underlying Ethernet device closes, the LAPB device is also closed.

However, currently the LAPB device is closed after the Ethernet device closes. It would be better to close it before the Ethernet device closes. This would allow the LAPB device to transmit a last frame to notify the other side that it is disconnecting.

[...]

Here is the summary with links:
- [net-next] net: lapbether: Close the LAPB device before its underlying Ethernet device closes

    https://git.kernel.org/netdev/net-next/c/536e1004d273

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html