aboutsummaryrefslogtreecommitdiffstats
path: root/net/bridge
diff options
context:
space:
mode:
authorThomas Graf <tgraf@suug.ch>2006-08-15 03:36:28 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-09-22 17:54:59 -0400
commit280a306c539389156477cc9c07028d43fe4fbf86 (patch)
tree956c9fe4e045236bb02980ebe35edc489c6bb47a /net/bridge
parent8c384bfa36b1dbeba8154da20d49167ce3e275c4 (diff)
[BRIDGE]: Convert notifications to use rtnl_notify()
Fixes a wrong use of current->pid as netlink pid. Signed-off-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge')
-rw-r--r--net/bridge/br_netlink.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
index 53086fb75089..8f661195d09d 100644
--- a/net/bridge/br_netlink.c
+++ b/net/bridge/br_netlink.c
@@ -12,6 +12,7 @@
12 12
13#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <linux/rtnetlink.h> 14#include <linux/rtnetlink.h>
15#include <net/netlink.h>
15#include "br_private.h" 16#include "br_private.h"
16 17
17/* 18/*
@@ -76,26 +77,24 @@ rtattr_failure:
76void br_ifinfo_notify(int event, struct net_bridge_port *port) 77void br_ifinfo_notify(int event, struct net_bridge_port *port)
77{ 78{
78 struct sk_buff *skb; 79 struct sk_buff *skb;
79 int err = -ENOMEM; 80 int payload = sizeof(struct ifinfomsg) + 128;
81 int err = -ENOBUFS;
80 82
81 pr_debug("bridge notify event=%d\n", event); 83 pr_debug("bridge notify event=%d\n", event);
82 skb = alloc_skb(NLMSG_SPACE(sizeof(struct ifinfomsg) + 128), 84 skb = nlmsg_new(nlmsg_total_size(payload), GFP_ATOMIC);
83 GFP_ATOMIC); 85 if (skb == NULL)
84 if (!skb) 86 goto errout;
85 goto err_out; 87
88 err = br_fill_ifinfo(skb, port, 0, 0, event, 0);
89 if (err < 0) {
90 kfree_skb(skb);
91 goto errout;
92 }
86 93
87 err = br_fill_ifinfo(skb, port, current->pid, 0, event, 0); 94 err = rtnl_notify(skb, 0, RTNLGRP_LINK, NULL, GFP_ATOMIC);
95errout:
88 if (err < 0) 96 if (err < 0)
89 goto err_kfree; 97 rtnl_set_sk_err(RTNLGRP_LINK, err);
90
91 NETLINK_CB(skb).dst_group = RTNLGRP_LINK;
92 netlink_broadcast(rtnl, skb, 0, RTNLGRP_LINK, GFP_ATOMIC);
93 return;
94
95err_kfree:
96 kfree_skb(skb);
97err_out:
98 netlink_set_err(rtnl, 0, RTNLGRP_LINK, err);
99} 98}
100 99
101/* 100/*