On 23/02/2019 00:12, Ben Pfaff wrote:
> On Fri, Feb 15, 2019 at 12:16:14AM +0100, Matthias May via dev wrote:
>> There are switches which allow to transmit their BPDUs VLAN-tagged.
>> With this change OVS is able to receive VLAN-tagged BPDUs, but still
>> transmits its own BPDUs untagged.
>> This was tested against Westermo RFI-207-F4G-T3G.
>>
>> v2: Send patch to different address of mailing list according to suggestion
>>     of Flavio Leitner.
>>
>> Signed-off-by: Matthias May <[email protected]>
> 
> I applied this to master.  Thanks!
> 
> I fussed with it a bit to make it closer to the preferred style.  Here
> is what I committed:
> 
> --8<--------------------------cut here-------------------------->8--
> 
> From: Matthias May <[email protected]>
> Date: Fri, 15 Feb 2019 00:16:14 +0100
> Subject: [PATCH] rstp: add ability to receive VLAN-tagged BPDUs
> 
> There are switches which allow to transmit their BPDUs VLAN-tagged.
> With this change OVS is able to receive VLAN-tagged BPDUs, but still
> transmits its own BPDUs untagged.
> This was tested against Westermo RFI-207-F4G-T3G.
> 
> Signed-off-by: Matthias May <[email protected]>
> Signed-off-by: Ben Pfaff <[email protected]>
> ---
>  ofproto/ofproto-dpif-xlate.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c
> index acd4817c2549..81b72be37eb5 100644
> --- a/ofproto/ofproto-dpif-xlate.c
> +++ b/ofproto/ofproto-dpif-xlate.c
> @@ -1787,7 +1787,11 @@ rstp_process_packet(const struct xport *xport, const 
> struct dp_packet *packet)
>          dp_packet_set_size(&payload, ntohs(eth->eth_type) + ETH_HEADER_LEN);
>      }
>  
> -    if (dp_packet_try_pull(&payload, ETH_HEADER_LEN + LLC_HEADER_LEN)) {
> +    int len = ETH_HEADER_LEN + LLC_HEADER_LEN;
> +    if (eth->eth_type == htons(ETH_TYPE_VLAN)) {
> +        len += VLAN_HEADER_LEN;
> +    }
> +    if (dp_packet_try_pull(&payload, len)) {
>          rstp_port_received_bpdu(xport->rstp_port, dp_packet_data(&payload),
>                                  dp_packet_size(&payload));
>      }
> 

OK.
Thank you.

BR
Matthias
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to