summaryrefslogtreecommitdiffstats
path: root/zebra/kernel_netlink.c
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas.abraitis@gmail.com>2020-03-08 20:43:26 +0100
committerDonatas Abraitis <donatas.abraitis@gmail.com>2020-03-08 20:44:53 +0100
commit0d6f7fd6fd9dcaa62fb77a10d3a1ad8d0d74f980 (patch)
treedb39fd913f349a353a62ead250210aab49a8cc09 /zebra/kernel_netlink.c
parentMerge pull request #5924 from donaldsharp/more_func (diff)
downloadfrr-0d6f7fd6fd9dcaa62fb77a10d3a1ad8d0d74f980.tar.xz
frr-0d6f7fd6fd9dcaa62fb77a10d3a1ad8d0d74f980.zip
*: Replace `sizeof something` to sizeof(something)
Satisfy checkpatch.pl requirements (check for sizeof without parenthesis) Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
Diffstat (limited to 'zebra/kernel_netlink.c')
-rw-r--r--zebra/kernel_netlink.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/zebra/kernel_netlink.c b/zebra/kernel_netlink.c
index 0d25798d3..97b023836 100644
--- a/zebra/kernel_netlink.c
+++ b/zebra/kernel_netlink.c
@@ -231,12 +231,12 @@ static int netlink_socket(struct nlsock *nl, unsigned long groups,
return -1;
}
- memset(&snl, 0, sizeof snl);
+ memset(&snl, 0, sizeof(snl));
snl.nl_family = AF_NETLINK;
snl.nl_groups = groups;
/* Bind the socket to the netlink structure for anything. */
- ret = bind(sock, (struct sockaddr *)&snl, sizeof snl);
+ ret = bind(sock, (struct sockaddr *)&snl, sizeof(snl));
}
if (ret < 0) {
@@ -247,9 +247,9 @@ static int netlink_socket(struct nlsock *nl, unsigned long groups,
}
/* multiple netlink sockets will have different nl_pid */
- namelen = sizeof snl;
+ namelen = sizeof(snl);
ret = getsockname(sock, (struct sockaddr *)&snl, (socklen_t *)&namelen);
- if (ret < 0 || namelen != sizeof snl) {
+ if (ret < 0 || namelen != sizeof(snl)) {
flog_err_sys(EC_LIB_SOCKET, "Can't get %s socket name: %s",
nl->name, safe_strerror(errno));
close(sock);
@@ -738,10 +738,10 @@ int netlink_parse_info(int (*filter)(struct nlmsghdr *, ns_id_t, int),
while (1) {
char buf[NL_RCV_PKT_BUF_SIZE];
- struct iovec iov = {.iov_base = buf, .iov_len = sizeof buf};
+ struct iovec iov = {.iov_base = buf, .iov_len = sizeof(buf)};
struct sockaddr_nl snl;
struct msghdr msg = {.msg_name = (void *)&snl,
- .msg_namelen = sizeof snl,
+ .msg_namelen = sizeof(snl),
.msg_iov = &iov,
.msg_iovlen = 1};
struct nlmsghdr *h;
@@ -783,7 +783,7 @@ int netlink_parse_info(int (*filter)(struct nlmsghdr *, ns_id_t, int),
return -1;
}
- if (msg.msg_namelen != sizeof snl) {
+ if (msg.msg_namelen != sizeof(snl)) {
flog_err(EC_ZEBRA_NETLINK_LENGTH_ERROR,
"%s sender address length error: length %d",
nl->name, msg.msg_namelen);
@@ -989,14 +989,14 @@ int netlink_talk_info(int (*filter)(struct nlmsghdr *, ns_id_t, int startup),
int save_errno = 0;
const struct nlsock *nl;
- memset(&snl, 0, sizeof snl);
- memset(&iov, 0, sizeof iov);
- memset(&msg, 0, sizeof msg);
+ memset(&snl, 0, sizeof(snl));
+ memset(&iov, 0, sizeof(iov));
+ memset(&msg, 0, sizeof(msg));
iov.iov_base = n;
iov.iov_len = n->nlmsg_len;
msg.msg_name = (void *)&snl;
- msg.msg_namelen = sizeof snl;
+ msg.msg_namelen = sizeof(snl);
msg.msg_iov = &iov;
msg.msg_iovlen = 1;
@@ -1077,13 +1077,13 @@ int netlink_request(struct nlsock *nl, struct nlmsghdr *n)
n->nlmsg_pid = nl->snl.nl_pid;
n->nlmsg_seq = ++nl->seq;
- memset(&snl, 0, sizeof snl);
+ memset(&snl, 0, sizeof(snl));
snl.nl_family = AF_NETLINK;
/* Raise capabilities and send message, then lower capabilities. */
frr_with_privs(&zserv_privs) {
ret = sendto(nl->sock, (void *)n, n->nlmsg_len, 0,
- (struct sockaddr *)&snl, sizeof snl);
+ (struct sockaddr *)&snl, sizeof(snl));
}
if (ret < 0) {