mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 06:15:47 +00:00
lib: Replace IP_TYPE_ references with IPPROTO_.
A few common IP protocol types were defined in "lib/packets.h". However, we already assume the existence of <netinet/in.h> which contains a more exhaustive list and should be available on POSIX systems.
This commit is contained in:
@@ -1216,10 +1216,10 @@ dp_netdev_set_nw_addr(struct ofpbuf *packet, const struct flow *key,
|
||||
uint32_t *field;
|
||||
|
||||
field = type == ODP_ACTION_ATTR_SET_NW_SRC ? &nh->ip_src : &nh->ip_dst;
|
||||
if (key->nw_proto == IP_TYPE_TCP && packet->l7) {
|
||||
if (key->nw_proto == IPPROTO_TCP && packet->l7) {
|
||||
struct tcp_header *th = packet->l4;
|
||||
th->tcp_csum = recalc_csum32(th->tcp_csum, *field, ip);
|
||||
} else if (key->nw_proto == IP_TYPE_UDP && packet->l7) {
|
||||
} else if (key->nw_proto == IPPROTO_UDP && packet->l7) {
|
||||
struct udp_header *uh = packet->l4;
|
||||
if (uh->udp_csum) {
|
||||
uh->udp_csum = recalc_csum32(uh->udp_csum, *field, ip);
|
||||
|
Reference in New Issue
Block a user