Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 403133 | Differences between
and this patch

Collapse All | Expand All

(-)a/keepalived/libipvs-2.6/libipvs.c (-6 / +6 lines)
Lines 1003-1014 static int ipvs_daemon_parse_cb(struct nl_msg *msg, void *arg) Link Here
1003
	struct nlattr *attrs[IPVS_CMD_ATTR_MAX + 1];
1003
	struct nlattr *attrs[IPVS_CMD_ATTR_MAX + 1];
1004
	struct nlattr *daemon_attrs[IPVS_DAEMON_ATTR_MAX + 1];
1004
	struct nlattr *daemon_attrs[IPVS_DAEMON_ATTR_MAX + 1];
1005
	ipvs_daemon_t *u = (ipvs_daemon_t *)arg;
1005
	ipvs_daemon_t *u = (ipvs_daemon_t *)arg;
1006
	__u32 state;
1006
	int i = 0;
1007
	int i = 0;
1007
1008
1008
	/* We may get two daemons.  If we've already got one, this is the second */
1009
	if (u[0].state)
1010
		i = 1;
1011
1012
	if (genlmsg_parse(nlh, 0, attrs, IPVS_CMD_ATTR_MAX, ipvs_cmd_policy) != 0)
1009
	if (genlmsg_parse(nlh, 0, attrs, IPVS_CMD_ATTR_MAX, ipvs_cmd_policy) != 0)
1013
		return -1;
1010
		return -1;
1014
	
1011
	
Lines 1021-1027 static int ipvs_daemon_parse_cb(struct nl_msg *msg, void *arg) Link Here
1021
	      daemon_attrs[IPVS_DAEMON_ATTR_SYNC_ID]))
1018
	      daemon_attrs[IPVS_DAEMON_ATTR_SYNC_ID]))
1022
		return -1;
1019
		return -1;
1023
1020
1024
	u[i].state = nla_get_u32(daemon_attrs[IPVS_DAEMON_ATTR_STATE]);
1021
	state = nla_get_u32(daemon_attrs[IPVS_DAEMON_ATTR_STATE]);
1022
	/* The second element is used for the state of the backup daemon. */
1023
	if (state == IP_VS_STATE_BACKUP)
1024
		i = 1;
1025
	u[i].state = state;
1025
	strncpy(u[i].mcast_ifn,
1026
	strncpy(u[i].mcast_ifn,
1026
		nla_get_string(daemon_attrs[IPVS_DAEMON_ATTR_MCAST_IFN]),
1027
		nla_get_string(daemon_attrs[IPVS_DAEMON_ATTR_MCAST_IFN]),
1027
		IP_VS_IFNAME_MAXLEN);
1028
		IP_VS_IFNAME_MAXLEN);
1028
- 

Return to bug 403133