[ovs-dev] [PATCH RFC 2/3] send garp on localnet

Ramu Ramamurthy ramu.ramamurthy at gmail.com
Thu Mar 31 22:16:19 UTC 2016


On Thu, Mar 31, 2016 at 12:33 PM, Numan Siddique <nusiddiq at redhat.com> wrote:
>>
>> +/* Add a new vif to announce garps */
>> +static void
>> +send_garp_add(const struct sbrec_port_binding *binding_rec,
>> +              int ofport)
>> +{
>> +    int i;
>> +    for (i = 0; i < binding_rec->n_mac; i++) {
>> +        struct lport_addresses laddrs;
>> +        if (extract_lport_addresses(binding_rec->mac[i], &laddrs,
>> +                                    false)) {
>> +            /* the mac address must be valid */
>> +            struct garp_data *garp = xmalloc(sizeof(struct garp_data));
>> +            garp->ofport = ofport;
>> +            garp->ea = laddrs.ea;
>> +            garp->ipv4 = 0;
>> +            if (laddrs.n_ipv4_addrs) {
>> +                garp->ipv4 = laddrs.ipv4_addrs[0].addr;
>>
>
> You have to free laddrs.ipv4_addrs.
>
> Also I think you can merge patchset 2 and 3 as patch 3 tests patch 2
>
Thanks  !, I missed the free of laddrs.ipv4_addr,
In the next version, I will combine the test with the code in one commit.



More information about the dev mailing list