From e50b20539b8a809021a1337288df332c825ccd3d Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Wed, 10 Jul 2013 11:42:00 +0200 Subject: [PATCH] kernel-pfroute: Use ref_get() to allocate sequence numbers --- src/libhydra/plugins/kernel_pfroute/kernel_pfroute_net.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libhydra/plugins/kernel_pfroute/kernel_pfroute_net.c b/src/libhydra/plugins/kernel_pfroute/kernel_pfroute_net.c index 011cc1b64f..13da679e4a 100644 --- a/src/libhydra/plugins/kernel_pfroute/kernel_pfroute_net.c +++ b/src/libhydra/plugins/kernel_pfroute/kernel_pfroute_net.c @@ -1015,7 +1015,7 @@ static status_t manage_route(private_kernel_pfroute_net_t *this, int op, .rtm_type = op, .rtm_flags = RTF_UP | RTF_STATIC, .rtm_pid = this->pid, - .rtm_seq = ++this->seq, + .rtm_seq = ref_get(&this->seq), }, }; host_t *dst; @@ -1119,7 +1119,7 @@ static host_t *get_route(private_kernel_pfroute_net_t *this, bool nexthop, .rtm_version = RTM_VERSION, .rtm_type = RTM_GET, .rtm_pid = this->pid, - .rtm_seq = ++this->seq, + .rtm_seq = ref_get(&this->seq), }, }; host_t *host = NULL; @@ -1217,7 +1217,7 @@ retry: if (src) { /* the given source address might be gone, try again without */ src = NULL; - msg.hdr.rtm_seq = ++this->seq; + msg.hdr.rtm_seq = ref_get(&this->seq); msg.hdr.rtm_addrs = 0; memset(msg.buf, sizeof(msg.buf), 0); goto retry; -- 2.47.2