if (ps->n_ipv4_addrs) {
ds_put_cstr(&match, " && arp.spa == {");
- for (size_t i = 0; i < ps->n_ipv4_addrs; i++) {
+ for (size_t j = 0; j < ps->n_ipv4_addrs; j++) {
/* When the netmask is applied, if the host portion is
* non-zero, the host can only use the specified
* address in the arp.spa. If zero, the host is allowed
* to use any address in the subnet. */
- if (ps->ipv4_addrs[i].plen == 32
- || ps->ipv4_addrs[i].addr & ~ps->ipv4_addrs[i].mask) {
- ds_put_cstr(&match, ps->ipv4_addrs[i].addr_s);
+ if (ps->ipv4_addrs[j].plen == 32
+ || ps->ipv4_addrs[j].addr & ~ps->ipv4_addrs[j].mask) {
+ ds_put_cstr(&match, ps->ipv4_addrs[j].addr_s);
} else {
ds_put_format(&match, "%s/%d",
- ps->ipv4_addrs[i].network_s,
- ps->ipv4_addrs[i].plen);
+ ps->ipv4_addrs[j].network_s,
+ ps->ipv4_addrs[j].plen);
}
ds_put_cstr(&match, ", ");
}
op->json_key, ps->ea_s);
}
- for (int i = 0; i < ps->n_ipv4_addrs; i++) {
- ovs_be32 mask = ps->ipv4_addrs[i].mask;
+ for (int j = 0; j < ps->n_ipv4_addrs; j++) {
+ ovs_be32 mask = ps->ipv4_addrs[j].mask;
/* When the netmask is applied, if the host portion is
* non-zero, the host can only use the specified
* address. If zero, the host is allowed to use any
* address in the subnet.
*/
- if (ps->ipv4_addrs[i].plen == 32
- || ps->ipv4_addrs[i].addr & ~mask) {
- ds_put_format(&match, "%s", ps->ipv4_addrs[i].addr_s);
- if (pipeline == P_OUT && ps->ipv4_addrs[i].plen != 32) {
+ if (ps->ipv4_addrs[j].plen == 32
+ || ps->ipv4_addrs[j].addr & ~mask) {
+ ds_put_format(&match, "%s", ps->ipv4_addrs[j].addr_s);
+ if (pipeline == P_OUT && ps->ipv4_addrs[j].plen != 32) {
/* Host is also allowed to receive packets to the
* broadcast address in the specified subnet. */
ds_put_format(&match, ", %s",
- ps->ipv4_addrs[i].bcast_s);
+ ps->ipv4_addrs[j].bcast_s);
}
} else {
/* host portion is zero */
- ds_put_format(&match, "%s/%d", ps->ipv4_addrs[i].network_s,
- ps->ipv4_addrs[i].plen);
+ ds_put_format(&match, "%s/%d", ps->ipv4_addrs[j].network_s,
+ ps->ipv4_addrs[j].plen);
}
ds_put_cstr(&match, ", ");
}