[pve-devel] [PATCH ifupdown2] add patch to add arp-accept option

Alexandre Derumier aderumier at odiso.com
Tue Sep 3 10:07:16 CEST 2019


needed for bgp-evpn

upstream pull request:
https://github.com/CumulusNetworks/ifupdown2/pull/121

Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 .../pve/0009-add-arp-accept-option.patch      | 55 +++++++++++++++++++
 debian/patches/series                         |  1 +
 2 files changed, 56 insertions(+)
 create mode 100644 debian/patches/pve/0009-add-arp-accept-option.patch

diff --git a/debian/patches/pve/0009-add-arp-accept-option.patch b/debian/patches/pve/0009-add-arp-accept-option.patch
new file mode 100644
index 0000000..dd27ffb
--- /dev/null
+++ b/debian/patches/pve/0009-add-arp-accept-option.patch
@@ -0,0 +1,55 @@
+From 45db39f606e09486889128b93f1942639620d2aa Mon Sep 17 00:00:00 2001
+From: Alexandre Derumier <aderumier at odiso.com>
+Date: Tue, 3 Sep 2019 09:43:38 +0200
+Subject: [PATCH] add arp-accept option.
+
+Currently, the only way to enable arp-accept is to enable
+a policy with l3_intf_arp_accept.
+
+But this enable arp-accept for all bridges.
+
+This option allow to define it for specific bridge.
+
+This is needed with bgp-evpn and vm migration
+https://github.com/FRRouting/frr/issues/4904
+---
+ ifupdown2/addons/address.py | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/ifupdown2/addons/address.py b/ifupdown2/addons/address.py
+index f576dc0..762c58c 100644
+--- a/ifupdown2/addons/address.py
++++ b/ifupdown2/addons/address.py
+@@ -96,6 +96,11 @@ class address(moduleBase):
+                               'dual connected VxLANs',
+                               'validvals' : ['<ipv4>', ],
+                               'example'  : ['clagd-vxlan-anycast-ip 36.0.0.11']},
++                      'arp-accept' :
++                            { 'help': 'Allow gratuitous arp to update arp table',
++                              'validvals': ['on', 'off', 'yes', 'no', '0', '1'],
++                              'default' : 'off',
++                              'example' : ['arp-accept on']},
+                       'ip-forward' :
+                             { 'help': 'ip forwarding flag',
+                               'validvals': ['on', 'off', 'yes', 'no', '0', '1'],
+@@ -272,6 +277,8 @@ class address(moduleBase):
+     def _process_bridge(self, ifaceobj, up):
+         hwaddress = self._get_hwaddress(ifaceobj)
+         addrs = ifaceobj.get_attr_value_first('address')
++        arp_accept = ifaceobj.get_attr_value_first('arp-accept')
++        arp_accept = utils.boolean_support_binary(arp_accept)
+         is_vlan_dev_on_vlan_aware_bridge = False
+         is_bridge = self.ipcmd.is_bridge(ifaceobj.name)
+         if not is_bridge:
+@@ -290,7 +297,7 @@ class address(moduleBase):
+                         self.write_file('/proc/sys/net/ipv4/conf/%s' % ifaceobj.name +
+                                         '/arp_accept', '0')
+                 else:
+-                    self.write_file('/proc/sys/net/ipv4/conf/%s/arp_accept' % ifaceobj.name, '0')
++                    self.write_file('/proc/sys/net/ipv4/conf/%s/arp_accept' % ifaceobj.name, arp_accept)
+         if hwaddress and is_vlan_dev_on_vlan_aware_bridge:
+            if up:
+               self.ipcmd.bridge_fdb_add(bridgename, hwaddress, vlan)
+-- 
+2.20.1
+
diff --git a/debian/patches/series b/debian/patches/series
index feea3bc..a66998f 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -6,3 +6,4 @@ pve/0005-don-t-remove-bridge-is-tap-veth-are-still-plugged.patch
 pve/0006-add-uplink-id-option.patch
 pve/0007-ifreload-down-up-vxlan-interfaces-when-ifreload_down.patch
 pve/0008-config-tuning.patch
+pve/0009-add-arp-accept-option.patch
-- 
2.20.1




More information about the pve-devel mailing list