]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[TCP] westwood: Use type safe netlink interface
authorThomas Graf <tgraf@suug.ch>
Fri, 23 Mar 2007 06:27:19 +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_westwood.c

index 1f91aeae10aff11c66e8c04b826e5b5b67268f32..ae1026a67720dc6586249b23ba74e8866ac0588b 100644 (file)
@@ -260,16 +260,13 @@ static void tcp_westwood_info(struct sock *sk, u32 ext,
 {
        const struct westwood *ca = inet_csk_ca(sk);
        if (ext & (1 << (INET_DIAG_VEGASINFO - 1))) {
-               struct rtattr *rta;
-               struct tcpvegas_info *info;
-
-               rta = __RTA_PUT(skb, INET_DIAG_VEGASINFO, sizeof(*info));
-               info = RTA_DATA(rta);
-               info->tcpv_enabled = 1;
-               info->tcpv_rttcnt = 0;
-               info->tcpv_rtt = jiffies_to_usecs(ca->rtt);
-               info->tcpv_minrtt = jiffies_to_usecs(ca->rtt_min);
-       rtattr_failure: ;
+               struct tcpvegas_info info = {
+                       .tcpv_enabled = 1,
+                       .tcpv_rtt = jiffies_to_usecs(ca->rtt),
+                       .tcpv_minrtt = jiffies_to_usecs(ca->rtt_min),
+               };
+
+               nla_put(skb, INET_DIAG_VEGASINFO, sizeof(info), &info);
        }
 }