OpenWrt Forum Archive

Topic: [Solved] l2tpv3 help needed

The content of this topic has been archived on 3 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hello.
Would like ask here If someone could change some of source code for l2tpv3.  I need add availability for changing mac address of l2tpeth interfaces. I need add 2 or more l2tpeth interfaces to bond and without change mac address of it is impossible as round Robin

(Last edited by milankocvara on 18 Mar 2016, 15:30)

Any idea?

for next generation testers :-)

From abefb1b5a943b0355c6678e9117630b3a9df24e4 Mon Sep 17 00:00:00 2001
From: James Chapman <jchapman@katalix.com>
Date: Tue, 22 Apr 2014 08:24:59 +0100
Subject: [PATCH] l2tp: add ability to change MAC address of l2tpeth net
devices

It can sometimes be useful to change the MAC address of L2TP virtual
netdevices, e.g. bonding. The L2TP ethernet driver was missing this
facility. This patch adds it.
---
net/l2tp/l2tp_eth.c |    3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/l2tp/l2tp_eth.c b/net/l2tp/l2tp_eth.c
index 76125c5..1e73b35 100644
--- a/net/l2tp/l2tp_eth.c
+++ b/net/l2tp/l2tp_eth.c
@@ -120,12 +120,13 @@ static struct rtnl_link_stats64 *l2tp_eth_get_stats64(struct net_device *dev,
        return stats;
}

-
static struct net_device_ops l2tp_eth_netdev_ops = {
        .ndo_init               = l2tp_eth_dev_init,
        .ndo_uninit             = l2tp_eth_dev_uninit,
        .ndo_start_xmit         = l2tp_eth_dev_xmit,
        .ndo_get_stats64        = l2tp_eth_get_stats64,
+       .ndo_validate_addr      = eth_validate_addr,
+       .ndo_set_mac_address    = eth_mac_addr,
};

static void l2tp_eth_dev_setup(struct net_device *dev)
--
1.7.9.5

(Last edited by milankocvara on 22 Apr 2014, 09:42)

The discussion might have continued from here.