projects
/
people
/
alex
/
keepalived.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
46c54ec
)
VRRP: Fix incorrect computation for packet size
author
Vincent Bernat
<bernat@luffy.cx>
Sat, 17 Jul 2010 17:56:55 +0000
(17:56 +0000)
committer
Alexandre Cassen
<acassen@lnxos-dev.(none)>
Wed, 8 Dec 2010 10:40:30 +0000
(11:40 +0100)
Ternary conditional operator has lower precedence than addition. The
size of the VRRP packet was incorrectly computed and there was not
enough room for plain authentication string.
keepalived/vrrp/vrrp.c
patch
|
blob
|
history
diff --git
a/keepalived/vrrp/vrrp.c
b/keepalived/vrrp/vrrp.c
index
7463d47
..
4710cf9
100644
(file)
--- a/
keepalived/vrrp/vrrp.c
+++ b/
keepalived/vrrp/vrrp.c
@@
-86,7
+86,7
@@
vrrp_hd_len(vrrp_rt * vrrp)
{
int len = sizeof (vrrp_pkt);
if (vrrp->family == AF_INET)
- len += VRRP_AUTH_LEN + (!LIST_ISEMPTY(vrrp->vip)) ? LIST_SIZE(vrrp->vip) * sizeof (uint32_t) : 0;
+ len += VRRP_AUTH_LEN + ((!LIST_ISEMPTY(vrrp->vip)) ? LIST_SIZE(vrrp->vip) * sizeof (uint32_t) : 0);
return len;
}