From 0e12b4620b03f68bfdb7f6b7007c8cde9bdf0a9e Mon Sep 17 00:00:00 2001 From: "Nicholas J. Kain" Date: Mon, 17 Mar 2014 22:58:55 -0400 Subject: [PATCH] Cosmetic cleanups. --- ndhc/nl.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/ndhc/nl.c b/ndhc/nl.c index 06e2576..292e32a 100644 --- a/ndhc/nl.c +++ b/ndhc/nl.c @@ -54,15 +54,12 @@ int rtattr_assign(struct rtattr *attr, int type, void *data) int nl_add_rtattr(struct nlmsghdr *n, size_t max_length, int type, const void *data, size_t data_length) { - size_t length; - struct rtattr *rta; - - length = RTA_LENGTH(data_length); + size_t length = RTA_LENGTH(data_length); if (NLMSG_ALIGN(n->nlmsg_len) + RTA_ALIGN(length) > max_length) return -E2BIG; - rta = NLMSG_TAIL(n); + struct rtattr *rta = NLMSG_TAIL(n); rta->rta_type = type; rta->rta_len = length; memcpy(RTA_DATA(rta), data, data_length);