Commit 2809cec5 authored by David S. Miller's avatar David S. Miller

caif: Stop using NLA_PUT*().

These macros contain a hidden goto, and are thus extremely error
prone and make code hard to audit.
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 14ad6647
...@@ -421,14 +421,14 @@ static int ipcaif_fill_info(struct sk_buff *skb, const struct net_device *dev) ...@@ -421,14 +421,14 @@ static int ipcaif_fill_info(struct sk_buff *skb, const struct net_device *dev)
struct chnl_net *priv; struct chnl_net *priv;
u8 loop; u8 loop;
priv = netdev_priv(dev); priv = netdev_priv(dev);
NLA_PUT_U32(skb, IFLA_CAIF_IPV4_CONNID, if (nla_put_u32(skb, IFLA_CAIF_IPV4_CONNID,
priv->conn_req.sockaddr.u.dgm.connection_id); priv->conn_req.sockaddr.u.dgm.connection_id) ||
NLA_PUT_U32(skb, IFLA_CAIF_IPV6_CONNID, nla_put_u32(skb, IFLA_CAIF_IPV6_CONNID,
priv->conn_req.sockaddr.u.dgm.connection_id); priv->conn_req.sockaddr.u.dgm.connection_id))
goto nla_put_failure;
loop = priv->conn_req.protocol == CAIFPROTO_DATAGRAM_LOOP; loop = priv->conn_req.protocol == CAIFPROTO_DATAGRAM_LOOP;
NLA_PUT_U8(skb, IFLA_CAIF_LOOPBACK, loop); if (nla_put_u8(skb, IFLA_CAIF_LOOPBACK, loop))
goto nla_put_failure;
return 0; return 0;
nla_put_failure: nla_put_failure:
return -EMSGSIZE; return -EMSGSIZE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment