[TCP] vegas: Use type safe netlink interface
authorThomas Graf <tgraf@suug.ch>
Fri, 23 Mar 2007 06:27:01 +0000 (23:27 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Thu, 26 Apr 2007 05:27:26 +0000 (22:27 -0700)
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp_vegas.c

index 5c484dc..87e72be 100644 (file)
@@ -341,16 +341,14 @@ static void tcp_vegas_get_info(struct sock *sk, u32 ext,
 {
        const struct vegas *ca = inet_csk_ca(sk);
        if (ext & (1 << (INET_DIAG_VEGASINFO - 1))) {
-               struct tcpvegas_info *info;
-
-               info = RTA_DATA(__RTA_PUT(skb, INET_DIAG_VEGASINFO,
-                                         sizeof(*info)));
-
-               info->tcpv_enabled = ca->doing_vegas_now;
-               info->tcpv_rttcnt = ca->cntRTT;
-               info->tcpv_rtt = ca->baseRTT;
-               info->tcpv_minrtt = ca->minRTT;
-       rtattr_failure: ;
+               struct tcpvegas_info info = {
+                       .tcpv_enabled = ca->doing_vegas_now,
+                       .tcpv_rttcnt = ca->cntRTT,
+                       .tcpv_rtt = ca->baseRTT,
+                       .tcpv_minrtt = ca->minRTT,
+               };
+
+               nla_put(skb, INET_DIAG_VEGASINFO, sizeof(info), &info);
        }
 }