mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-15 13:05:11 +00:00
Merge pull request #3119 from pacovn/Coverity_1465497_dead_code
zebra: dead code (Coverity 1465497)
This commit is contained in:
commit
41df11abc7
@ -220,21 +220,16 @@ ns_id_t zebra_ns_id_get(const char *netnspath)
|
||||
nlh = (struct nlmsghdr *)buf;
|
||||
|
||||
/* message to analyse : NEWNSID response */
|
||||
len = ret;
|
||||
ret = 0;
|
||||
do {
|
||||
if (nlh->nlmsg_type >= NLMSG_MIN_TYPE) {
|
||||
return_nsid = extract_nsid(nlh, buf);
|
||||
if (return_nsid != NS_UNKNOWN)
|
||||
break;
|
||||
} else {
|
||||
if (nlh->nlmsg_type == NLMSG_ERROR) {
|
||||
struct nlmsgerr *err =
|
||||
(struct nlmsgerr
|
||||
*)((char *)nlh
|
||||
+ NETLINK_ALIGN(sizeof(
|
||||
struct
|
||||
nlmsghdr)));
|
||||
+ NETLINK_ALIGN(
|
||||
sizeof(struct nlmsghdr)));
|
||||
|
||||
ret = -1;
|
||||
if (err->error < 0)
|
||||
@ -253,13 +248,8 @@ ns_id_t zebra_ns_id_get(const char *netnspath)
|
||||
*/
|
||||
ret = -1;
|
||||
errno = EEXIST;
|
||||
break;
|
||||
}
|
||||
}
|
||||
len = len - NETLINK_ALIGN(nlh->nlmsg_len);
|
||||
nlh = (struct nlmsghdr *)((char *)nlh
|
||||
+ NETLINK_ALIGN(nlh->nlmsg_len));
|
||||
} while (len != 0 && return_nsid != NS_UNKNOWN && ret == 0);
|
||||
|
||||
if (ret <= 0) {
|
||||
if (errno != EEXIST && ret != 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user