Przeglądaj źródła

[RTNETLINK]: Don't return error on no-metrics.

Instead just cancel the nested attribute and return 0.

Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller 18 lat temu
rodzic
commit
a57d27fc71
1 zmienionych plików z 4 dodań i 2 usunięć
  1. 4 2
      net/core/rtnetlink.c

+ 4 - 2
net/core/rtnetlink.c

@@ -202,8 +202,10 @@ int rtnetlink_put_metrics(struct sk_buff *skb, u32 *metrics)
 		}
 	}
 
-	if (!valid)
-		goto nla_put_failure;
+	if (!valid) {
+		nla_nest_cancel(skb, mx);
+		return 0;
+	}
 
 	return nla_nest_end(skb, mx);