diff options
author | Johannes Berg <johannes.berg@intel.com> | 2013-11-19 09:19:37 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-11-19 16:39:06 -0500 |
commit | 62b68e99faa802352e9cb2ae91adecd8dfddf1b8 (patch) | |
tree | a76d8342a57b8451bef657919201c76a5333f1f1 /net/openvswitch | |
parent | c2ebb908469d507ff400dad94efc755e6c799672 (diff) |
genetlink: add and use genl_set_err()
Add a static inline to generic netlink to wrap netlink_set_err()
to make it easier to use here - use it in openvswitch (the only
generic netlink user of netlink_set_err()).
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/openvswitch')
-rw-r--r-- | net/openvswitch/datapath.c | 8 | ||||
-rw-r--r-- | net/openvswitch/dp_notify.c | 6 |
2 files changed, 7 insertions, 7 deletions
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c index 8ec8b73033e0..3e2bb15fd717 100644 --- a/net/openvswitch/datapath.c +++ b/net/openvswitch/datapath.c | |||
@@ -879,8 +879,8 @@ static int ovs_flow_cmd_new_or_set(struct sk_buff *skb, struct genl_info *info) | |||
879 | if (!IS_ERR(reply)) | 879 | if (!IS_ERR(reply)) |
880 | ovs_notify(reply, info, &ovs_dp_flow_multicast_group); | 880 | ovs_notify(reply, info, &ovs_dp_flow_multicast_group); |
881 | else | 881 | else |
882 | netlink_set_err(sock_net(skb->sk)->genl_sock, 0, | 882 | genl_set_err(sock_net(skb->sk), 0, |
883 | ovs_dp_flow_multicast_group.id, PTR_ERR(reply)); | 883 | ovs_dp_flow_multicast_group.id, PTR_ERR(reply)); |
884 | return 0; | 884 | return 0; |
885 | 885 | ||
886 | err_flow_free: | 886 | err_flow_free: |
@@ -1326,8 +1326,8 @@ static int ovs_dp_cmd_set(struct sk_buff *skb, struct genl_info *info) | |||
1326 | info->snd_seq, OVS_DP_CMD_NEW); | 1326 | info->snd_seq, OVS_DP_CMD_NEW); |
1327 | if (IS_ERR(reply)) { | 1327 | if (IS_ERR(reply)) { |
1328 | err = PTR_ERR(reply); | 1328 | err = PTR_ERR(reply); |
1329 | netlink_set_err(sock_net(skb->sk)->genl_sock, 0, | 1329 | genl_set_err(sock_net(skb->sk), 0, |
1330 | ovs_dp_datapath_multicast_group.id, err); | 1330 | ovs_dp_datapath_multicast_group.id, err); |
1331 | err = 0; | 1331 | err = 0; |
1332 | goto unlock; | 1332 | goto unlock; |
1333 | } | 1333 | } |
diff --git a/net/openvswitch/dp_notify.c b/net/openvswitch/dp_notify.c index 5c2dab276109..3d55ead6095c 100644 --- a/net/openvswitch/dp_notify.c +++ b/net/openvswitch/dp_notify.c | |||
@@ -34,9 +34,9 @@ static void dp_detach_port_notify(struct vport *vport) | |||
34 | OVS_VPORT_CMD_DEL); | 34 | OVS_VPORT_CMD_DEL); |
35 | ovs_dp_detach_port(vport); | 35 | ovs_dp_detach_port(vport); |
36 | if (IS_ERR(notify)) { | 36 | if (IS_ERR(notify)) { |
37 | netlink_set_err(ovs_dp_get_net(dp)->genl_sock, 0, | 37 | genl_set_err(ovs_dp_get_net(dp), 0, |
38 | ovs_dp_vport_multicast_group.id, | 38 | ovs_dp_vport_multicast_group.id, |
39 | PTR_ERR(notify)); | 39 | PTR_ERR(notify)); |
40 | return; | 40 | return; |
41 | } | 41 | } |
42 | 42 | ||