]> git.proxmox.com Git - mirror_frr.git/commitdiff
Zebra: Address review comments for RMAC FPM feature 1
authorAmeya Dharkar <adharkar@vmware.com>
Mon, 17 Jun 2019 19:03:41 +0000 (12:03 -0700)
committerAmeya Dharkar <adharkar@vmware.com>
Mon, 17 Jun 2019 19:05:38 +0000 (12:05 -0700)
Address minor review comments.

Signed-off-by: Ameya Dharkar <adharkar@vmware.com>
zebra/zebra_fpm.c
zebra/zebra_fpm_netlink.c

index 3e74db8111d8fe64de376c73c7993e1cdc41ed24..32b9763c56a5ac4da95d3681ae35a75df7842a54 100644 (file)
@@ -1030,7 +1030,7 @@ static int zfpm_build_route_updates(void)
                         */
                        return FPM_GOTO_NEXT_Q;
                }
-       } while (1);
+       } while (true);
 }
 
 /*
@@ -1623,8 +1623,7 @@ static int zfpm_trigger_rmac_update(zebra_mac_t *rmac, zebra_l3vni_t *zl3vni,
        if (!fpm_mac)
                return 0;
 
-       memcpy(&fpm_mac->zebra_flags, &rmac->flags, sizeof(uint32_t));
-
+       fpm_mac->zebra_flags = rmac->flags;
        fpm_mac->vxlan_if = vxlan_if ? vxlan_if->ifindex : 0;
        fpm_mac->svi_if = svi_if ? svi_if->ifindex : 0;
 
index 4f2013585d271992b6884320067f8c8c7f591420..d5479bc627ae1ba777d636bf0ef166825995bec0 100644 (file)
@@ -594,14 +594,14 @@ int zfpm_netlink_encode_mac(struct fpm_mac_info_t *mac, char *in_buf,
        char buf1[ETHER_ADDR_STRLEN];
        size_t buf_offset;
 
-       struct {
+       struct macmsg {
                struct nlmsghdr hdr;
                struct ndmsg ndm;
                char buf[0];
        } *req;
        req = (void *)in_buf;
 
-       buf_offset = ((char *)req->buf) - ((char *)req);
+       buf_offset = offsetof(struct macmsg, buf);
        if (in_buf_len < buf_offset)
                return 0;
        memset(req, 0, buf_offset);