When the set_tp_src or set_tp_dst action is used, the calculation for
where the checksum is located was wrong. This caused the checksum to
not be updated and packet corruption in the bad offset.
u16 *f = a->type == ODPAT_SET_TP_SRC ? &th->source : &th->dest;
u16 old = *f;
u16 new = a->tp_port;
- update_csum((u16*)((u8*)skb->data + check_ofs),
- skb, old, new, 1);
+ update_csum((u16*)(skb_transport_header(skb) + check_ofs),
+ skb, old, new, 1);
*f = new;
}
return skb;