On Sun, Jan 10, 2016 at 05:58:13PM +0100, Denis Fondras wrote:
> On Sun, Jan 10, 2016 at 03:42:34PM +0000, Christian Weisgerber wrote:
> > You don't actually describe your interface configuration. I _guess_
> > you are trying to terminate IP traffic directly on an svlan(4)
> > interface. That sounds very unusual.
> >
>
> Sorry, the configuration is actually :
> /etc/hostname.em1 :
> up
>
> /etc/hostname.svlan1003 :
> vlandev em1
> inet 100.67.233.1/30
> up
> !route add 185.22.128.252/30 100.67.233.2
>
> Network diagram :
> OpenBSD(vlanid:1003) ---- Switch ---- (vlanid:1003)router ---
> client(185.22.128.253)
>
> > I can see why it might fail. Since svlan(4) encapsulation is not
> > covered by the hardware VLAN support, it changes the offsets to the
> > IP/TCP headers, which is something the em(4) driver doesn't handle.
> >
>
> Thank you for the insight.
naddy is right, the extre header confuses things. i just rewrote
vlan(4) and thought this could happen.
this is a minimal diff that should work.
can you try this and see?
Index: if_vlan.c
===================================================================
RCS file: /cvs/src/sys/net/if_vlan.c,v
retrieving revision 1.150
diff -u -p -r1.150 if_vlan.c
--- if_vlan.c 8 Dec 2015 11:35:42 -0000 1.150
+++ if_vlan.c 11 Jan 2016 00:07:20 -0000
@@ -430,24 +430,24 @@ vlan_config(struct ifvlan *ifv, struct i
vlan_set_promisc(&ifv->ifv_if);
}
- /*
- * If the parent interface can do hardware-assisted
- * VLAN encapsulation, then propagate its hardware-
- * assisted checksumming flags.
- *
- * If the card cannot handle hardware tagging, it cannot
- * possibly compute the correct checksums for tagged packets.
- */
- if (p->if_capabilities & IFCAP_VLAN_HWTAGGING)
+ if (ifv->ifv_type != ETHERTYPE_VLAN) {
+ /*
+ * Hardware VLAN tagging only works with the default VLAN
+ * ethernet type (0x8100).
+ */
+ ifv->ifv_if.if_capabilities = 0;
+ } else if (p->if_capabilities & IFCAP_VLAN_HWTAGGING) {
+ /*
+ * If the parent interface can do hardware-assisted
+ * VLAN encapsulation, then propagate its hardware-
+ * assisted checksumming flags.
+ *
+ * If the card cannot handle hardware tagging, it cannot
+ * possibly compute the correct checksums for tagged packets.
+ */
ifv->ifv_if.if_capabilities = p->if_capabilities &
IFCAP_CSUM_MASK;
-
- /*
- * Hardware VLAN tagging only works with the default VLAN
- * ethernet type (0x8100).
- */
- if (ifv->ifv_type != ETHERTYPE_VLAN)
- ifv->ifv_if.if_capabilities &= ~IFCAP_VLAN_HWTAGGING;
+ }
/*
* Set up our ``Ethernet address'' to reflect the underlying