+ skb = make_writable(skb, 0);
+ if (unlikely(!skb))
+ return NULL;
+
+ nh = ip_hdr(skb);
+ nwaddr = nla_type(a) == ODPAT_SET_NW_SRC ? &nh->saddr : &nh->daddr;
+
+ check = get_l4_checksum(skb, key);
+ if (likely(check))
+ inet_proto_csum_replace4(check, skb, *nwaddr, new_nwaddr, 1);
+ csum_replace4(&nh->check, *nwaddr, new_nwaddr);
+
+ *nwaddr = new_nwaddr;
+
+ return skb;
+}
+
+static struct sk_buff *set_nw_tos(struct sk_buff *skb,
+ const struct odp_flow_key *key,
+ u8 nw_tos)
+{
+ if (unlikely(!is_ip(skb, key)))
+ return skb;
+
+ skb = make_writable(skb, 0);