Skip to content

Commit 3d0371b

Browse files
sammjdavem330
authored andcommitted
net/ncsi: Fixup .dumpit message flags and ID check in Netlink handler
The ncsi_pkg_info_all_nl() .dumpit handler is missing the NLM_F_MULTI flag, causing additional package information after the first to be lost. Also fixup a sanity check in ncsi_write_package_info() to reject out of range package IDs. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 00e1cae commit 3d0371b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

net/ncsi/ncsi-netlink.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ static int ncsi_write_package_info(struct sk_buff *skb,
100100
bool found;
101101
int rc;
102102

103-
if (id > ndp->package_num) {
103+
if (id > ndp->package_num - 1) {
104104
netdev_info(ndp->ndev.dev, "NCSI: No package with id %u\n", id);
105105
return -ENODEV;
106106
}
@@ -240,7 +240,7 @@ static int ncsi_pkg_info_all_nl(struct sk_buff *skb,
240240
return 0; /* done */
241241

242242
hdr = genlmsg_put(skb, NETLINK_CB(cb->skb).portid, cb->nlh->nlmsg_seq,
243-
&ncsi_genl_family, 0, NCSI_CMD_PKG_INFO);
243+
&ncsi_genl_family, NLM_F_MULTI, NCSI_CMD_PKG_INFO);
244244
if (!hdr) {
245245
rc = -EMSGSIZE;
246246
goto err;

0 commit comments

Comments
 (0)