kernel-pfroute: Use ref_get() to allocate sequence numbers
This commit is contained in:
@@ -1015,7 +1015,7 @@ static status_t manage_route(private_kernel_pfroute_net_t *this, int op,
|
|||||||
.rtm_type = op,
|
.rtm_type = op,
|
||||||
.rtm_flags = RTF_UP | RTF_STATIC,
|
.rtm_flags = RTF_UP | RTF_STATIC,
|
||||||
.rtm_pid = this->pid,
|
.rtm_pid = this->pid,
|
||||||
.rtm_seq = ++this->seq,
|
.rtm_seq = ref_get(&this->seq),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
host_t *dst;
|
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_version = RTM_VERSION,
|
||||||
.rtm_type = RTM_GET,
|
.rtm_type = RTM_GET,
|
||||||
.rtm_pid = this->pid,
|
.rtm_pid = this->pid,
|
||||||
.rtm_seq = ++this->seq,
|
.rtm_seq = ref_get(&this->seq),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
host_t *host = NULL;
|
host_t *host = NULL;
|
||||||
@@ -1217,7 +1217,7 @@ retry:
|
|||||||
if (src)
|
if (src)
|
||||||
{ /* the given source address might be gone, try again without */
|
{ /* the given source address might be gone, try again without */
|
||||||
src = NULL;
|
src = NULL;
|
||||||
msg.hdr.rtm_seq = ++this->seq;
|
msg.hdr.rtm_seq = ref_get(&this->seq);
|
||||||
msg.hdr.rtm_addrs = 0;
|
msg.hdr.rtm_addrs = 0;
|
||||||
memset(msg.buf, sizeof(msg.buf), 0);
|
memset(msg.buf, sizeof(msg.buf), 0);
|
||||||
goto retry;
|
goto retry;
|
||||||
|
|||||||
Reference in New Issue
Block a user