This patch adds an option to disable the creation of tagged priority packets
with VID=0. This is for the feature_vlan_tagging openvpn-testing head.

I tested the vlan feature and it works fine for me (no dhcp tested).
Therefore I bridged my eth0 (LAN) and tap0 (OpenVPN) but as my switch
flags arp replys with priority, the client ended up with 802.1q tagged
(VID=0) priority packets. These were not expected on the client (Ubuntu 10.04 lts) and I found a linux kernel discussion from summer 2010 about supporting VID=0 priority packets, so I expect more linux clients (windows untested) to not support
this kind of packets.
This option prevents the creating of these packets by ignoring the priority information.

This patch has already been tested and works fine for me.

Signed-off-by: Michael Braun <michael-...@fami-braun.de>


---
 multi.c   |    2 +-
 options.c |    9 +++++++++
 options.h |    1 +
 3 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/multi.c b/multi.c
index b77791a..d09fa68 100644
--- a/multi.c
+++ b/multi.c
@@ -2246,7 +2246,7 @@ remove_vlan_tag (const struct context *c, struct buffer *buf)
       return c->options.vlan_pvid;
     }
 
-  if (pcp == 0)
+  if (pcp == 0 || c->options.vlan_disable_priority)
     {
       /* VLAN-tagged without priority information. */
 
diff --git a/options.c b/options.c
index 827b9f0..fe0eac6 100644
--- a/options.c
+++ b/options.c
@@ -763,6 +763,7 @@ init_options (struct options *o, const bool init_gc)
 #ifdef ENABLE_VLAN_TAGGING
   o->vlan_accept = VAF_ALL;
   o->vlan_pvid = 1;
+  o->vlan_disable_priority = false;
 #endif
 }
 
@@ -1037,6 +1038,7 @@ show_p2mp_parms (const struct options *o)
   SHOW_BOOL (vlan_tagging);
   msg (D_SHOW_PARMS, "  vlan_accept = %s", print_vlan_accept (o->vlan_accept));
   SHOW_INT (vlan_pvid);
+  SHOW_BOOL (vlan_disable_priority);
 #endif
 #endif /* P2MP_SERVER */
 
@@ -1783,6 +1785,8 @@ options_postprocess_verify_ce (const struct options *options, const struct conne
 	    msg (M_USAGE, "--vlan-accept requires --vlan-tagging");
 	  if (options->vlan_pvid != defaults.vlan_pvid)
 	    msg (M_USAGE, "--vlan-pvid requires --vlan-tagging");
+	  if (options->vlan_disable_priority != defaults.vlan_disable_priority)
+	    msg (M_USAGE, "--vlan_disable_priority requires --vlan-tagging");
 	}
 #endif
     }
@@ -5782,6 +5786,11 @@ add_option (struct options *options,
       VERIFY_PERMISSION (OPT_P_GENERAL);
       options->vlan_tagging = true;
     }
+  else if (streq (p[0], "vlan-disable-priority"))
+    {
+      VERIFY_PERMISSION (OPT_P_GENERAL);
+      options->vlan_disable_priority = true;
+    }
   else if (streq (p[0], "vlan-accept") && p[1])
     {
       VERIFY_PERMISSION (OPT_P_GENERAL);
diff --git a/options.h b/options.h
index a278561..5444e37 100644
--- a/options.h
+++ b/options.h
@@ -523,6 +523,7 @@ struct options
   bool vlan_tagging;
   enum vlan_acceptable_frames vlan_accept;
   uint16_t vlan_pvid;
+  bool vlan_disable_priority;
 #endif
 };
 
-- 
1.7.3.4

Reply via email to