]> git.proxmox.com Git - mirror_iproute2.git/blobdiff - ip/link_vti6.c
Use C99 style initializers everywhere
[mirror_iproute2.git] / ip / link_vti6.c
index 9bcf7fe9dea46a8f520e699e3c9ddf1960ccb0f0..7f32ee017f412d6bb75176c56034070a4e8661a8 100644 (file)
@@ -42,12 +42,18 @@ static void usage(void)
 static int vti6_parse_opt(struct link_util *lu, int argc, char **argv,
                          struct nlmsghdr *n)
 {
+       struct ifinfomsg *ifi = (struct ifinfomsg *)(n + 1);
        struct {
                struct nlmsghdr n;
                struct ifinfomsg i;
                char buf[1024];
-       } req;
-       struct ifinfomsg *ifi = (struct ifinfomsg *)(n + 1);
+       } req = {
+               .n.nlmsg_len = NLMSG_LENGTH(sizeof(*ifi)),
+               .n.nlmsg_flags = NLM_F_REQUEST,
+               .n.nlmsg_type = RTM_GETLINK,
+               .i.ifi_family = preferred_family,
+               .i.ifi_index = ifi->ifi_index,
+       };
        struct rtattr *tb[IFLA_MAX + 1];
        struct rtattr *linkinfo[IFLA_INFO_MAX+1];
        struct rtattr *vtiinfo[IFLA_VTI_MAX + 1];
@@ -59,14 +65,6 @@ static int vti6_parse_opt(struct link_util *lu, int argc, char **argv,
        int len;
 
        if (!(n->nlmsg_flags & NLM_F_CREATE)) {
-               memset(&req, 0, sizeof(req));
-
-               req.n.nlmsg_len = NLMSG_LENGTH(sizeof(*ifi));
-               req.n.nlmsg_flags = NLM_F_REQUEST;
-               req.n.nlmsg_type = RTM_GETLINK;
-               req.i.ifi_family = preferred_family;
-               req.i.ifi_index = ifi->ifi_index;
-
                if (rtnl_talk(&rth, &req.n, &req.n, sizeof(req)) < 0) {
 get_failed:
                        fprintf(stderr,