public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Robin H. Johnson" <robbat2@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/netifrc:master commit in: doc/, net/
Date: Mon,  5 Apr 2021 20:02:16 +0000 (UTC)	[thread overview]
Message-ID: <1590910107.0dc79645173fad82e0d437a6569b7ea7fa356197.robbat2@OpenRC> (raw)

commit:     0dc79645173fad82e0d437a6569b7ea7fa356197
Author:     Arseni Nimera <shorrer <AT> yandex <DOT> by>
AuthorDate: Sat May 30 22:20:25 2020 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Sun May 31 07:28:27 2020 +0000
URL:        https://gitweb.gentoo.org/proj/netifrc.git/commit/?id=0dc79645

Added macvtap support

Bug: https://bugs.gentoo.org/691372
Signed-off-by: Arseni Nimera <shorrer <AT> yandex.by>

 doc/net.example.Linux.in | 3 +++
 net/macvlan.sh           | 8 ++++++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/doc/net.example.Linux.in b/doc/net.example.Linux.in
index 8896acf..f169670 100644
--- a/doc/net.example.Linux.in
+++ b/doc/net.example.Linux.in
@@ -664,6 +664,9 @@
 # MAC-VLAN mode (private, vepa, bridge, passtru)
 #mode_macvlan0="private"
 
+# MAC-VLAN type (macvlan, macvtap)
+#type_macvlan0="macvtap"
+
 # IP address, MAC address, ... are configured as a normal interface
 #config_macvlan0="192.168.20.20/24"
 #mac_macvlan0="00:50:06:20:20:20"

diff --git a/net/macvlan.sh b/net/macvlan.sh
index 8d55717..6243858 100644
--- a/net/macvlan.sh
+++ b/net/macvlan.sh
@@ -34,8 +34,12 @@ macvlan_pre_start()
 	eval mode=\$mode_${IFVAR}
 	[ -z "${mode}" ] && mode="private"
 
+	local type=
+	eval type=\$type_${IFVAR}
+	[ -z "${type}" ] && type="macvlan"
+
 	ebegin "Creating MAC-VLAN ${IFACE} to ${macvlan}"
-	e="$(ip link add link "${macvlan}" name "${IFACE}" type macvlan mode "${mode}" 2>&1 1>/dev/null)"
+	e="$(ip link add link "${macvlan}" name "${IFACE}" type "${type}" mode "${mode}" 2>&1 1>/dev/null)"
 	if [ -n "${e}" ]; then
 		eend 1 "${e}"
 	else
@@ -49,6 +53,6 @@ macvlan_post_stop()
 	_is_macvlan || return 0
 
 	ebegin "Removing MAC-VLAN ${IFACE}"
-	ip link delete "${IFACE}" type macvlan >/dev/null
+	ip link delete "${IFACE}" >/dev/null
 	eend $?
 }


             reply	other threads:[~2021-04-05 20:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-05 20:02 Robin H. Johnson [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-08-28 16:46 [gentoo-commits] proj/netifrc:master commit in: doc/, net/ Patrick McLean
2019-04-21  4:12 Robin H. Johnson
2016-07-05 18:14 Robin H. Johnson
2015-11-08 14:30 Robin H. Johnson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1590910107.0dc79645173fad82e0d437a6569b7ea7fa356197.robbat2@OpenRC \
    --to=robbat2@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox