> Date: Mon, 20 Aug 2018 11:05:08 -0700
> From: Ori Bernstein <o...@eigenstate.org>
> 
> > As far as I know, switch(4) assumes it receives packets located at 64
> > bit aligned memory.  So if the code like below
> > 
> >     *(uint64_t *)oxm->oxm_value = htobe64(val);
> > 
> > cause alignment faults, the assumption may be broken.  If so, the
> > place we should fix may not be here.
> 
> The reason we are suspicious here is because oxm_value comes from struct
> ofp_ox_match, which is defined like this:
> 
>       struct ofp_ox_match {
>               uint16_t        oxm_class;
>               uint8_t         oxm_fh;
>               uint8_t         oxm_length;
>               uint8_t         oxm_value[0];
>       } __packed;

This means that unless ofp_ox_match is by some magic aligned on an odd
32-bit boundary, oxm_value is not aligned on a 64-bit boundary.  So a cast to 
quint64_t * is broken.

Reply via email to