Skip to content

Commit

Permalink
Merge pull request #576 from legend050709/fix_blklst_bug
Browse files Browse the repository at this point in the history
fix the bug that blklst configuration multicast msg send fail
  • Loading branch information
ywc689 authored Jun 15, 2020
2 parents 8ff7e44 + a2d8ccd commit f3cec02
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/inetaddr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1137,7 +1137,7 @@ static int ifa_msg_get_cb(struct dpvs_msg *msg)

if (!msg || (msg->len && msg->len != sizeof(idev)))
return EDPVS_INVAL;
ptr = msg->len ? (void*)msg->data : NULL;
ptr = msg->len ? (void *)msg->data : NULL;
idev = ptr ? (*(struct inet_device **)ptr) : NULL;

if (idev)
Expand Down
10 changes: 8 additions & 2 deletions src/ipvs/ip_vs_blklst.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,12 @@ static int dp_vs_blklst_del_lcore(int af, uint8_t proto, const union inet_addr *
return EDPVS_NOTEXIST;
}

static uint32_t blklst_msg_seq(void)
{
static uint32_t counter = 0;
return counter++;
}

static int dp_vs_blklst_add(int af, uint8_t proto, const union inet_addr *vaddr,
uint16_t vport, const union inet_addr *blklst)
{
Expand Down Expand Up @@ -145,7 +151,7 @@ static int dp_vs_blklst_add(int af, uint8_t proto, const union inet_addr *vaddr,
}

/*set blklst ip on all slave lcores*/
msg = msg_make(MSG_TYPE_BLKLST_ADD, 0, DPVS_MSG_MULTICAST,
msg = msg_make(MSG_TYPE_BLKLST_ADD, blklst_msg_seq(), DPVS_MSG_MULTICAST,
cid, sizeof(struct dp_vs_blklst_conf), &cf);
if (unlikely(!msg))
return EDPVS_NOMEM;
Expand Down Expand Up @@ -188,7 +194,7 @@ static int dp_vs_blklst_del(int af, uint8_t proto, const union inet_addr *vaddr,
}

/*del blklst ip on all slave lcores*/
msg = msg_make(MSG_TYPE_BLKLST_DEL, 0, DPVS_MSG_MULTICAST,
msg = msg_make(MSG_TYPE_BLKLST_DEL, blklst_msg_seq(), DPVS_MSG_MULTICAST,
cid, sizeof(struct dp_vs_blklst_conf), &cf);
if (!msg)
return EDPVS_NOMEM;
Expand Down

0 comments on commit f3cec02

Please sign in to comment.