[ovs-dev] [PATCH 4/6 RFC] ofproto/connmgr: notify controllers when their role changes to slave

Ben Pfaff blp at nicira.com
Tue Oct 8 21:17:22 UTC 2013


On Tue, Oct 08, 2013 at 12:26:21PM +0300, Alexandru Copot wrote:
> Signed-off-by: Alexandru Copot <alex.mihai.c at gmail.com>
> Cc: Daniel Baluta <dbaluta at ixiacom.com>

"sparse" says:

    ../lib/ofp-util.c:3920:19: warning: incorrect type in assignment (different base types)
    ../lib/ofp-util.c:3920:19:    expected restricted __be32 [usertype] role
    ../lib/ofp-util.c:3920:19:    got int enum ofp12_controller_role const [signed] role
    ../lib/ofp-util.c:3922:28: warning: incorrect type in assignment (different base types)
    ../lib/ofp-util.c:3922:28:    expected restricted __be64 [usertype] generation_id
    ../lib/ofp-util.c:3922:28:    got unsigned long long const [unsigned] [usertype] generation_id

Please put the return type and the function name on separate lines here:
> +void ofconn_send_role_status(struct ofconn *ofconn, uint32_t role, uint8_t reason)
> +{
> +    struct ofputil_role_status status;
> +    struct ofpbuf *buf;
> +
> +    status.reason = reason;
> +    status.role = role;

In ofconn_set_role(), I think that the top-level "if" statement should
be tightened from:
    if (role == OFPCR12_ROLE_MASTER) {
to:
    if (role != ofconn->role && role == OFPCR12_ROLE_MASTER) {
so that a controller that is already master and requests that it
become master does not receive a status message that it has been
demoted to a slave.

Thanks,

Ben.



More information about the dev mailing list