Skip to contentSkip to conversation

iproute2: macvlan: add "source" mode

PATCH Applied Michael Braun 2 participants 3 messages Sep 25, 2016 – Oct 26, 2016

Subsystems (2)

v3 of 5 Applied Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 iproute2: macvlan: add "source" mode

Adjusting iproute2 utility to support new macvlan link type mode called "source".

Example of commands that can be applied:
ip link add link eth0 name macvlan0 type macvlan mode source ip link set link dev macvlan0 type macvlan macaddr add 00:11:11:11:11:11 ip link set link dev macvlan0 type macvlan macaddr del 00:11:11:11:11:11 ip link set link dev macvlan0 type macvlan macaddr flush
ip -details link show dev macvlan0

Based on previous work of Stefan Gula <[email protected]>

Cc: [email protected]
--
v3: fix coding style, sorry for the noise

---
 include/linux/if_link.h |   2 +
 ip/iplink_macvlan.c     | 103 ++++++++++++++++++++++++++++++++++++++++++++++--
 man/man8/ip-link.8.in   |  57 +++++++++++++++++++++++++++
 3 files changed, 158 insertions(+), 4 deletions(-)
include/linux/if_link.h +2 -0
index 1feb708..ec5e64e 100644
@@ -401,6 +401,8 @@ enum macvlan_macaddr_mode {
 };
 
 #define MACVLAN_FLAG_NOPROMISC	1
+#define MACVLAN_FLAG_UNICAST	2
+#define MACVLAN_FLAG_UNICAST_ALL	4
 
 /* VRF section */
 enum {
ip/iplink_macvlan.c +99 -4

160 lines not on this page · raw message

man/man8/ip-link.8.in +57 -0

77 lines not on this page · raw message

Signature · 1 line
2.1.4
#1 lore raw
Quoted 10 lines · On Sun, 25 Sep 2016 21:08:55 +0200 Michael Braun <[email protected]>…

Adjusting iproute2 utility to support new macvlan link type mode called "source".

Example of commands that can be applied:
ip link add link eth0 name macvlan0 type macvlan mode source ip link set link dev macvlan0 type macvlan macaddr add 00:11:11:11:11:11 ip link set link dev macvlan0 type macvlan macaddr del 00:11:11:11:11:11 ip link set link dev macvlan0 type macvlan macaddr flush
ip -details link show dev macvlan0

Quoted 5 lines

Based on previous work of Stefan Gula <[email protected]>

Applied.

#2 lore raw
In reply to Michael Braun
Quoted 28 lines · On Sun, 25 Sep 2016 21:08:55 +0200 Michael Braun <[email protected]>…

Adjusting iproute2 utility to support new macvlan link type mode called "source".

Example of commands that can be applied:
ip link add link eth0 name macvlan0 type macvlan mode source ip link set link dev macvlan0 type macvlan macaddr add 00:11:11:11:11:11 ip link set link dev macvlan0 type macvlan macaddr del 00:11:11:11:11:11 ip link set link dev macvlan0 type macvlan macaddr flush
ip -details link show dev macvlan0

Based on previous work of Stefan Gula <[email protected]>

Cc: [email protected]
--
v3: fix coding style, sorry for the noise

---
 include/linux/if_link.h |   2 +
 ip/iplink_macvlan.c     | 103 ++++++++++++++++++++++++++++++++++++++++++++++--
 man/man8/ip-link.8.in   |  57 +++++++++++++++++++++++++++
 3 files changed, 158 insertions(+), 4 deletions(-)
include/linux/if_link.h +0 -0
index 1feb708..ec5e64e 100644

include/linux/if_link.h enum macvlan_macaddr_mode { · line 405

Quoted 5 lines
include/linux/if_link.h +2 -0
@@ -401,6 +401,8 @@ enum macvlan_macaddr_mode {
 };
 
 #define MACVLAN_FLAG_NOPROMISC	1
+#define MACVLAN_FLAG_UNICAST	2
+#define MACVLAN_FLAG_UNICAST_ALL	4

These header changes are not in upstream source. Sorry, you have to get the kernel changes in first. I am backing this out of iproute2