2 May 2011 10:03
Re: [PATCH 2/2] datapath: Hash only the part of struct sw_flow_key populated by flow_extract().
On Sat, 2011-04-30 at 14:29 -0700, Andrew Evans wrote: > On Fri, 2011-04-29 at 19:58 -0700, Jesse Gross wrote: > > I was thinking about this a bit more and realized that we have to be > > more careful about how we handle invalid packets, not just here but in > > other places as well. In some places if the packet is invalid then we > > don't set length to include the invalid headers. At first I thought > > this was correct but it's actually a significant problem. Take IPv6 > > for example: if the length of the packet is shorter than the IPv6 > > header then we won't include the IPv6 fields. However, this means > > that the extracted flow will actually match any IPv6 flow, which is > > clearly not right. Instead we need to include the length of the IPv6 > > fields so that we will compare them and know that we are looking at an > > invalid packet. > > Ah, now your comments about setting key_len to the end of the ipv4/ipv6 > structs makes sense to me. I'll change the code to always set the key > length to the end of the IPv4/IPv6 structs if any of the respective > fields are set. Ok, I think there are only three flow key lengths that make sense: 1. to end of Ethernet headers 2. to end of IPv4 headers 3. to end of IPv6 headers If that's true, then there's no point in incrementing the flow key length as we go field-by-field. We should just set it to wherever the end would be if it were valid based on the protocol information in the packet. I was able to remove a lot of key_len assignment clutter as a result.(Continue reading)
RSS Feed