diff --git a/include/haproxy/server-t.h b/include/haproxy/server-t.h index e7f774762..e7be7a3e0 100644 --- a/include/haproxy/server-t.h +++ b/include/haproxy/server-t.h @@ -429,6 +429,7 @@ struct event_hdl_cb_data_server { */ char name[64]; /* server name/id */ char proxy_name[64]; /* id of proxy the server belongs to */ + int proxy_uuid; /* uuid of the proxy the server belongs to */ int puid; /* proxy-unique server ID */ uint32_t rid; /* server id revision */ unsigned int flags; /* server flags */ diff --git a/src/server.c b/src/server.c index 12475375c..d17436cfe 100644 --- a/src/server.c +++ b/src/server.c @@ -151,8 +151,12 @@ static inline void srv_event_hdl_publish(struct event_hdl_sub_type event, struct cb_data.safe.rid = srv->rid; cb_data.safe.flags = srv->flags; snprintf(cb_data.safe.name, sizeof(cb_data.safe.name), "%s", srv->id); - if (srv->proxy) + cb_data.safe.proxy_name[0] = '\0'; + cb_data.safe.proxy_uuid = -1; /* default value */ + if (srv->proxy) { + cb_data.safe.proxy_uuid = srv->proxy->uuid; snprintf(cb_data.safe.proxy_name, sizeof(cb_data.safe.proxy_name), "%s", srv->proxy->id); + } /* unsafe data assignments */ cb_data.unsafe.ptr = srv; cb_data.unsafe.thread_isolate = thread_isolate;