From 35607dd0607bca5322860703143c31cb04377764 Mon Sep 17 00:00:00 2001
From: Stephen Moorby <steve.moorby@xxxxxxxxxxxx>
Date: Wed, 19 Jun 2013 08:22:51 +0100
Subject: [PATCH 1/1] drivers/net: param for lapbether for specific ethernet
device
The lapbether driver binds to the first ethernet device that comes up.[...]
This causes problems in hardware with multiple ethernet interfaces,
potentially resulting in the LAPB traffic on the wrong interface.
Have added a module parameter 'eth_dev' to specify the ethernet
interface over which lapbether should operate. The module behaves
as before if no device is specified.
Patch created on linux-next 18-Jun-2013.
Tested on 2.6.32-45-generic.
Signed-off-by: Stephen Moorby <steve.moorby@xxxxxxxxxxxx>
---
drivers/net/wan/lapbether.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wan/lapbether.c b/drivers/net/wan/lapbether.c
index a33a46f..510fc4a 100644
--- a/drivers/net/wan/lapbether.c
+++ b/drivers/net/wan/lapbether.c
@@ -381,8 +382,14 @@ static int lapbeth_device_event(struct
notifier_block *this,
switch (event) {
case NETDEV_UP:
/* New ethernet device -> new LAPB interface */
- if (lapbeth_get_x25_dev(dev) == NULL)
- lapbeth_new_device(dev);
+ if (lapbeth_get_x25_dev(dev) == NULL) {
+ if (NULL != eth_dev) {
+ if (0 == strcmp(dev->name, eth_dev))
+ lapbeth_new_device(dev);
+ } else {
+ lapbeth_new_device(dev);
+ }
+ }