On Wed, Nov 28, 2018 at 03:17:10PM +0100, Daniel Alvarez Sanchez wrote: > On Wed, Nov 28, 2018 at 3:10 PM Ben Pfaff <[email protected]> wrote: > > > > On Wed, Nov 28, 2018 at 12:07:55PM +0100, Daniel Alvarez Sanchez wrote: > > > On Mon, Nov 26, 2018 at 9:30 PM Ben Pfaff <[email protected]> wrote: > > > > > > > > On Fri, Nov 16, 2018 at 06:41:33PM +0100, Daniel Alvarez Sanchez wrote: > > > > > +static void > > > > > +delete_mac_binding_by_ip(struct northd_context *ctx, const char *ip) > > > > > +{ > > > > > + const struct sbrec_mac_binding *b, *n; > > > > > + SBREC_MAC_BINDING_FOR_EACH_SAFE (b, n, ctx->ovnsb_idl) { > > > > > + if (strstr(ip, b->ip)) { > > > > > + sbrec_mac_binding_delete(b); > > > > > + } > > > > > + } > > > > > +} > > > > > > > > I haven't read the whole thread properly yet, but: why does this use > > > > strstr()? > > > > > > I used it because b->ip could be like "50:57:00:00:00:02 20.0.0.10" > > > and wanted to check if the IP address was present there. > > > > Is the 'ip' column in the MAC_Binding table documented incorrectly? It > > is currently documented as: > > > > ip: string > > The bound IP address. > > > > which doesn't mention strings that also contain a MAC address. > Sorry for the confusion, the prototype is misleading. It's not the > 'ip' col of the MAC_Binding table but the 'mac' column of the > Port_Binding table which is what's being passed to the > 'delete_mac_binding_by_ip()' function. > + for (int i = 0; i < op->sb->n_mac; i++) { > + delete_mac_binding_by_ip(ctx, op->sb->mac[i]);
Got it, thanks. _______________________________________________ discuss mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-discuss
