kernel-netlink: Simplify rt_entry_t initialization
authorTobias Brunner <tobias@strongswan.org>
Thu, 22 Feb 2018 08:49:57 +0000 (09:49 +0100)
committerTobias Brunner <tobias@strongswan.org>
Wed, 28 Feb 2018 14:32:25 +0000 (15:32 +0100)
src/libcharon/plugins/kernel_netlink/kernel_netlink_net.c

index c3f92f5..6c31a48 100644 (file)
@@ -1832,15 +1832,11 @@ static rt_entry_t *parse_route(struct nlmsghdr *hdr, rt_entry_t *route)
 
        if (route)
        {
-               route->gtw = chunk_empty;
-               route->pref_src = chunk_empty;
-               route->dst = chunk_empty;
-               route->dst_len = msg->rtm_dst_len;
-               route->src = chunk_empty;
-               route->src_len = msg->rtm_src_len;
-               route->table = msg->rtm_table;
-               route->oif = 0;
-               route->priority = 0;
+               *route = (rt_entry_t){
+                       .dst_len = msg->rtm_dst_len,
+                       .src_len = msg->rtm_src_len,
+                       .table = msg->rtm_table,
+               };
        }
        else
        {