You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6: (25 commits) [TG3]: Fix msi issue with kexec/kdump. [NET] XFRM: Fix whitespace errors. [NET] TIPC: Fix whitespace errors. [NET] SUNRPC: Fix whitespace errors. [NET] SCTP: Fix whitespace errors. [NET] RXRPC: Fix whitespace errors. [NET] ROSE: Fix whitespace errors. [NET] RFKILL: Fix whitespace errors. [NET] PACKET: Fix whitespace errors. [NET] NETROM: Fix whitespace errors. [NET] NETFILTER: Fix whitespace errors. [NET] IPV4: Fix whitespace errors. [NET] DCCP: Fix whitespace errors. [NET] CORE: Fix whitespace errors. [NET] BLUETOOTH: Fix whitespace errors. [NET] AX25: Fix whitespace errors. [PATCH] mac80211: remove rtnl locking in ieee80211_sta.c [PATCH] mac80211: fix GCC warning on 64bit platforms [GENETLINK]: Dynamic multicast groups. [NETLIKN]: Allow removing multicast groups. ...
This commit is contained in:
+1
-1
@@ -1262,7 +1262,7 @@ static int __must_check ax25_connect(struct socket *sock,
|
||||
|
||||
for (;;) {
|
||||
prepare_to_wait(sk->sk_sleep, &wait,
|
||||
TASK_INTERRUPTIBLE);
|
||||
TASK_INTERRUPTIBLE);
|
||||
if (sk->sk_state != TCP_SYN_SENT)
|
||||
break;
|
||||
if (!signal_pending(current)) {
|
||||
|
||||
@@ -982,7 +982,7 @@ int hci_recv_fragment(struct hci_dev *hdev, int type, void *data, int count)
|
||||
|
||||
skb->dev = (void *) hdev;
|
||||
bt_cb(skb)->pkt_type = type;
|
||||
|
||||
|
||||
__reassembly(hdev, type) = skb;
|
||||
|
||||
scb = (void *) skb->cb;
|
||||
|
||||
+1
-1
@@ -2629,7 +2629,7 @@ void __dev_set_rx_mode(struct net_device *dev)
|
||||
return;
|
||||
|
||||
if (!netif_device_present(dev))
|
||||
return;
|
||||
return;
|
||||
|
||||
if (dev->set_rx_mode)
|
||||
dev->set_rx_mode(dev);
|
||||
|
||||
@@ -98,7 +98,7 @@ int rtattr_parse(struct rtattr *tb[], int maxattr, struct rtattr *rta, int len)
|
||||
}
|
||||
|
||||
int __rtattr_parse_nested_compat(struct rtattr *tb[], int maxattr,
|
||||
struct rtattr *rta, int len)
|
||||
struct rtattr *rta, int len)
|
||||
{
|
||||
if (RTA_PAYLOAD(rta) < len)
|
||||
return -1;
|
||||
|
||||
+1
-1
@@ -230,7 +230,7 @@ static int sock_set_timeout(long *timeo_p, char __user *optval, int optlen)
|
||||
warned++;
|
||||
printk(KERN_INFO "sock_set_timeout: `%s' (pid %d) "
|
||||
"tries to set negative timeout\n",
|
||||
current->comm, current->pid);
|
||||
current->comm, current->pid);
|
||||
return 0;
|
||||
}
|
||||
*timeo_p = MAX_SCHEDULE_TIMEOUT;
|
||||
|
||||
@@ -227,7 +227,7 @@ void dccp_li_update_li(struct sock *sk,
|
||||
struct list_head *li_hist_list,
|
||||
struct list_head *hist_list,
|
||||
struct timeval *last_feedback, u16 s, u32 bytes_recv,
|
||||
u32 previous_x_recv, u64 seq_loss, u8 win_loss)
|
||||
u32 previous_x_recv, u64 seq_loss, u8 win_loss)
|
||||
{
|
||||
struct dccp_li_hist_entry *head;
|
||||
u64 seq_temp;
|
||||
|
||||
@@ -817,7 +817,7 @@ static void nl_fib_input(struct sock *sk, int len)
|
||||
static void nl_fib_lookup_init(void)
|
||||
{
|
||||
netlink_kernel_create(NETLINK_FIB_LOOKUP, 0, nl_fib_input, NULL,
|
||||
THIS_MODULE);
|
||||
THIS_MODULE);
|
||||
}
|
||||
|
||||
static void fib_disable_ip(struct net_device *dev, int force)
|
||||
|
||||
@@ -86,7 +86,7 @@ int ip_forward(struct sk_buff *skb)
|
||||
goto sr_failed;
|
||||
|
||||
if (unlikely(skb->len > dst_mtu(&rt->u.dst) &&
|
||||
(ip_hdr(skb)->frag_off & htons(IP_DF))) && !skb->local_df) {
|
||||
(ip_hdr(skb)->frag_off & htons(IP_DF))) && !skb->local_df) {
|
||||
IP_INC_STATS(IPSTATS_MIB_FRAGFAILS);
|
||||
icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED,
|
||||
htonl(dst_mtu(&rt->u.dst)));
|
||||
|
||||
@@ -1615,7 +1615,7 @@ u32 __tcp_select_window(struct sock *sk)
|
||||
if (window <= free_space - mss || window > free_space)
|
||||
window = (free_space/mss)*mss;
|
||||
else if (mss == full_space &&
|
||||
free_space > window + full_space/2)
|
||||
free_space > window + full_space/2)
|
||||
window = free_space;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ mac80211-objs := \
|
||||
ieee80211_iface.o \
|
||||
ieee80211_rate.o \
|
||||
michael.o \
|
||||
regdomain.o \
|
||||
tkip.o \
|
||||
aes_ccm.o \
|
||||
wme.o \
|
||||
|
||||
@@ -397,6 +397,8 @@ static int netdev_notify(struct notifier_block * nb,
|
||||
void *ndev)
|
||||
{
|
||||
struct net_device *dev = ndev;
|
||||
struct dentry *dir;
|
||||
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
|
||||
char buf[10+IFNAMSIZ];
|
||||
|
||||
if (state != NETDEV_CHANGENAME)
|
||||
@@ -408,10 +410,11 @@ static int netdev_notify(struct notifier_block * nb,
|
||||
if (dev->ieee80211_ptr->wiphy->privid != mac80211_wiphy_privid)
|
||||
return 0;
|
||||
|
||||
/* TODO
|
||||
sprintf(buf, "netdev:%s", dev->name);
|
||||
debugfs_rename(IEEE80211_DEV_TO_SUB_IF(dev)->debugfsdir, buf);
|
||||
*/
|
||||
dir = sdata->debugfsdir;
|
||||
if (!debugfs_rename(dir->d_parent, dir, dir->d_parent, buf))
|
||||
printk(KERN_ERR "mac80211: debugfs: failed to rename debugfs "
|
||||
"dir to %s\n", buf);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -4986,8 +4986,8 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
|
||||
* and we need some headroom for passing the frame to monitor
|
||||
* interfaces, but never both at the same time.
|
||||
*/
|
||||
local->tx_headroom = max(local->hw.extra_tx_headroom,
|
||||
sizeof(struct ieee80211_tx_status_rtap_hdr));
|
||||
local->tx_headroom = max_t(unsigned int , local->hw.extra_tx_headroom,
|
||||
sizeof(struct ieee80211_tx_status_rtap_hdr));
|
||||
|
||||
debugfs_hw_add(local);
|
||||
|
||||
@@ -5095,7 +5095,7 @@ int ieee80211_register_hwmode(struct ieee80211_hw *hw,
|
||||
}
|
||||
|
||||
if (!(hw->flags & IEEE80211_HW_DEFAULT_REG_DOMAIN_CONFIGURED))
|
||||
ieee80211_init_client(local->mdev);
|
||||
ieee80211_set_default_regdomain(mode);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -5246,6 +5246,7 @@ static int __init ieee80211_init(void)
|
||||
}
|
||||
|
||||
ieee80211_debugfs_netdev_init();
|
||||
ieee80211_regdomain_init();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -759,7 +759,6 @@ void ieee80211_update_default_wep_only(struct ieee80211_local *local);
|
||||
/* ieee80211_ioctl.c */
|
||||
int ieee80211_set_compression(struct ieee80211_local *local,
|
||||
struct net_device *dev, struct sta_info *sta);
|
||||
int ieee80211_init_client(struct net_device *dev);
|
||||
int ieee80211_set_channel(struct ieee80211_local *local, int channel, int freq);
|
||||
/* ieee80211_sta.c */
|
||||
void ieee80211_sta_timer(unsigned long data);
|
||||
@@ -798,6 +797,10 @@ void ieee80211_if_sdata_init(struct ieee80211_sub_if_data *sdata);
|
||||
int ieee80211_if_add_mgmt(struct ieee80211_local *local);
|
||||
void ieee80211_if_del_mgmt(struct ieee80211_local *local);
|
||||
|
||||
/* regdomain.c */
|
||||
void ieee80211_regdomain_init(void);
|
||||
void ieee80211_set_default_regdomain(struct ieee80211_hw_mode *mode);
|
||||
|
||||
/* for wiphy privid */
|
||||
extern void *mac80211_wiphy_privid;
|
||||
|
||||
|
||||
@@ -27,20 +27,6 @@
|
||||
#include "aes_ccm.h"
|
||||
#include "debugfs_key.h"
|
||||
|
||||
static int ieee80211_regdom = 0x10; /* FCC */
|
||||
module_param(ieee80211_regdom, int, 0444);
|
||||
MODULE_PARM_DESC(ieee80211_regdom, "IEEE 802.11 regulatory domain; 64=MKK");
|
||||
|
||||
/*
|
||||
* If firmware is upgraded by the vendor, additional channels can be used based
|
||||
* on the new Japanese regulatory rules. This is indicated by setting
|
||||
* ieee80211_japan_5ghz module parameter to one when loading the 80211 kernel
|
||||
* module.
|
||||
*/
|
||||
static int ieee80211_japan_5ghz /* = 0 */;
|
||||
module_param(ieee80211_japan_5ghz, int, 0444);
|
||||
MODULE_PARM_DESC(ieee80211_japan_5ghz, "Vendor-updated firmware for 5 GHz");
|
||||
|
||||
static void ieee80211_set_hw_encryption(struct net_device *dev,
|
||||
struct sta_info *sta, u8 addr[ETH_ALEN],
|
||||
struct ieee80211_key *key)
|
||||
@@ -412,125 +398,6 @@ static int ieee80211_ioctl_giwrange(struct net_device *dev,
|
||||
}
|
||||
|
||||
|
||||
struct ieee80211_channel_range {
|
||||
short start_freq;
|
||||
short end_freq;
|
||||
unsigned char power_level;
|
||||
unsigned char antenna_max;
|
||||
};
|
||||
|
||||
static const struct ieee80211_channel_range ieee80211_fcc_channels[] = {
|
||||
{ 2412, 2462, 27, 6 } /* IEEE 802.11b/g, channels 1..11 */,
|
||||
{ 5180, 5240, 17, 6 } /* IEEE 802.11a, channels 36..48 */,
|
||||
{ 5260, 5320, 23, 6 } /* IEEE 802.11a, channels 52..64 */,
|
||||
{ 5745, 5825, 30, 6 } /* IEEE 802.11a, channels 149..165, outdoor */,
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
static const struct ieee80211_channel_range ieee80211_mkk_channels[] = {
|
||||
{ 2412, 2472, 20, 6 } /* IEEE 802.11b/g, channels 1..13 */,
|
||||
{ 5170, 5240, 20, 6 } /* IEEE 802.11a, channels 34..48 */,
|
||||
{ 5260, 5320, 20, 6 } /* IEEE 802.11a, channels 52..64 */,
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
|
||||
static const struct ieee80211_channel_range *channel_range =
|
||||
ieee80211_fcc_channels;
|
||||
|
||||
|
||||
static void ieee80211_unmask_channel(struct net_device *dev, int mode,
|
||||
struct ieee80211_channel *chan)
|
||||
{
|
||||
int i;
|
||||
|
||||
chan->flag = 0;
|
||||
|
||||
if (ieee80211_regdom == 64 &&
|
||||
(mode == MODE_ATHEROS_TURBO || mode == MODE_ATHEROS_TURBOG)) {
|
||||
/* Do not allow Turbo modes in Japan. */
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = 0; channel_range[i].start_freq; i++) {
|
||||
const struct ieee80211_channel_range *r = &channel_range[i];
|
||||
if (r->start_freq <= chan->freq && r->end_freq >= chan->freq) {
|
||||
if (ieee80211_regdom == 64 && !ieee80211_japan_5ghz &&
|
||||
chan->freq >= 5260 && chan->freq <= 5320) {
|
||||
/*
|
||||
* Skip new channels in Japan since the
|
||||
* firmware was not marked having been upgraded
|
||||
* by the vendor.
|
||||
*/
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ieee80211_regdom == 0x10 &&
|
||||
(chan->freq == 5190 || chan->freq == 5210 ||
|
||||
chan->freq == 5230)) {
|
||||
/* Skip MKK channels when in FCC domain. */
|
||||
continue;
|
||||
}
|
||||
|
||||
chan->flag |= IEEE80211_CHAN_W_SCAN |
|
||||
IEEE80211_CHAN_W_ACTIVE_SCAN |
|
||||
IEEE80211_CHAN_W_IBSS;
|
||||
chan->power_level = r->power_level;
|
||||
chan->antenna_max = r->antenna_max;
|
||||
|
||||
if (ieee80211_regdom == 64 &&
|
||||
(chan->freq == 5170 || chan->freq == 5190 ||
|
||||
chan->freq == 5210 || chan->freq == 5230)) {
|
||||
/*
|
||||
* New regulatory rules in Japan have backwards
|
||||
* compatibility with old channels in 5.15-5.25
|
||||
* GHz band, but the station is not allowed to
|
||||
* use active scan on these old channels.
|
||||
*/
|
||||
chan->flag &= ~IEEE80211_CHAN_W_ACTIVE_SCAN;
|
||||
}
|
||||
|
||||
if (ieee80211_regdom == 64 &&
|
||||
(chan->freq == 5260 || chan->freq == 5280 ||
|
||||
chan->freq == 5300 || chan->freq == 5320)) {
|
||||
/*
|
||||
* IBSS is not allowed on 5.25-5.35 GHz band
|
||||
* due to radar detection requirements.
|
||||
*/
|
||||
chan->flag &= ~IEEE80211_CHAN_W_IBSS;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static int ieee80211_unmask_channels(struct net_device *dev)
|
||||
{
|
||||
struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
|
||||
struct ieee80211_hw_mode *mode;
|
||||
int c;
|
||||
|
||||
list_for_each_entry(mode, &local->modes_list, list) {
|
||||
for (c = 0; c < mode->num_channels; c++) {
|
||||
ieee80211_unmask_channel(dev, mode->mode,
|
||||
&mode->channels[c]);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int ieee80211_init_client(struct net_device *dev)
|
||||
{
|
||||
if (ieee80211_regdom == 0x40)
|
||||
channel_range = ieee80211_mkk_channels;
|
||||
ieee80211_unmask_channels(dev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int ieee80211_ioctl_siwmode(struct net_device *dev,
|
||||
struct iw_request_info *info,
|
||||
__u32 *mode, char *extra)
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
#include <linux/wireless.h>
|
||||
#include <linux/random.h>
|
||||
#include <linux/etherdevice.h>
|
||||
#include <linux/rtnetlink.h>
|
||||
#include <net/iw_handler.h>
|
||||
#include <asm/types.h>
|
||||
|
||||
@@ -2106,12 +2105,9 @@ static int ieee80211_sta_config_auth(struct net_device *dev,
|
||||
struct ieee80211_sta_bss *bss, *selected = NULL;
|
||||
int top_rssi = 0, freq;
|
||||
|
||||
rtnl_lock();
|
||||
|
||||
if (!ifsta->auto_channel_sel && !ifsta->auto_bssid_sel &&
|
||||
!ifsta->auto_ssid_sel) {
|
||||
ifsta->state = IEEE80211_AUTHENTICATE;
|
||||
rtnl_unlock();
|
||||
ieee80211_sta_reset_auth(dev, ifsta);
|
||||
return 0;
|
||||
}
|
||||
@@ -2154,7 +2150,6 @@ static int ieee80211_sta_config_auth(struct net_device *dev,
|
||||
ieee80211_sta_set_bssid(dev, selected->bssid);
|
||||
ieee80211_rx_bss_put(dev, selected);
|
||||
ifsta->state = IEEE80211_AUTHENTICATE;
|
||||
rtnl_unlock();
|
||||
ieee80211_sta_reset_auth(dev, ifsta);
|
||||
return 0;
|
||||
} else {
|
||||
@@ -2165,7 +2160,6 @@ static int ieee80211_sta_config_auth(struct net_device *dev,
|
||||
} else
|
||||
ifsta->state = IEEE80211_DISABLED;
|
||||
}
|
||||
rtnl_unlock();
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,158 @@
|
||||
/*
|
||||
* Copyright 2002-2005, Instant802 Networks, Inc.
|
||||
* Copyright 2005-2006, Devicescape Software, Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This regulatory domain control implementation is known to be incomplete
|
||||
* and confusing. mac80211 regulatory domain control will be significantly
|
||||
* reworked in the not-too-distant future.
|
||||
*
|
||||
* For now, drivers wishing to control which channels are and aren't available
|
||||
* are advised as follows:
|
||||
* - set the IEEE80211_HW_DEFAULT_REG_DOMAIN_CONFIGURED flag
|
||||
* - continue to include *ALL* possible channels in the modes registered
|
||||
* through ieee80211_register_hwmode()
|
||||
* - for each allowable ieee80211_channel structure registered in the above
|
||||
* call, set the flag member to some meaningful value such as
|
||||
* IEEE80211_CHAN_W_SCAN | IEEE80211_CHAN_W_ACTIVE_SCAN |
|
||||
* IEEE80211_CHAN_W_IBSS.
|
||||
* - leave flag as 0 for non-allowable channels
|
||||
*
|
||||
* The usual implementation is for a driver to read a device EEPROM to
|
||||
* determine which regulatory domain it should be operating under, then
|
||||
* looking up the allowable channels in a driver-local table, then performing
|
||||
* the above.
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/netdevice.h>
|
||||
#include <net/mac80211.h>
|
||||
#include "ieee80211_i.h"
|
||||
|
||||
static int ieee80211_regdom = 0x10; /* FCC */
|
||||
module_param(ieee80211_regdom, int, 0444);
|
||||
MODULE_PARM_DESC(ieee80211_regdom, "IEEE 802.11 regulatory domain; 64=MKK");
|
||||
|
||||
/*
|
||||
* If firmware is upgraded by the vendor, additional channels can be used based
|
||||
* on the new Japanese regulatory rules. This is indicated by setting
|
||||
* ieee80211_japan_5ghz module parameter to one when loading the 80211 kernel
|
||||
* module.
|
||||
*/
|
||||
static int ieee80211_japan_5ghz /* = 0 */;
|
||||
module_param(ieee80211_japan_5ghz, int, 0444);
|
||||
MODULE_PARM_DESC(ieee80211_japan_5ghz, "Vendor-updated firmware for 5 GHz");
|
||||
|
||||
|
||||
struct ieee80211_channel_range {
|
||||
short start_freq;
|
||||
short end_freq;
|
||||
unsigned char power_level;
|
||||
unsigned char antenna_max;
|
||||
};
|
||||
|
||||
static const struct ieee80211_channel_range ieee80211_fcc_channels[] = {
|
||||
{ 2412, 2462, 27, 6 } /* IEEE 802.11b/g, channels 1..11 */,
|
||||
{ 5180, 5240, 17, 6 } /* IEEE 802.11a, channels 36..48 */,
|
||||
{ 5260, 5320, 23, 6 } /* IEEE 802.11a, channels 52..64 */,
|
||||
{ 5745, 5825, 30, 6 } /* IEEE 802.11a, channels 149..165, outdoor */,
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
static const struct ieee80211_channel_range ieee80211_mkk_channels[] = {
|
||||
{ 2412, 2472, 20, 6 } /* IEEE 802.11b/g, channels 1..13 */,
|
||||
{ 5170, 5240, 20, 6 } /* IEEE 802.11a, channels 34..48 */,
|
||||
{ 5260, 5320, 20, 6 } /* IEEE 802.11a, channels 52..64 */,
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
|
||||
static const struct ieee80211_channel_range *channel_range =
|
||||
ieee80211_fcc_channels;
|
||||
|
||||
|
||||
static void ieee80211_unmask_channel(int mode, struct ieee80211_channel *chan)
|
||||
{
|
||||
int i;
|
||||
|
||||
chan->flag = 0;
|
||||
|
||||
if (ieee80211_regdom == 64 &&
|
||||
(mode == MODE_ATHEROS_TURBO || mode == MODE_ATHEROS_TURBOG)) {
|
||||
/* Do not allow Turbo modes in Japan. */
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = 0; channel_range[i].start_freq; i++) {
|
||||
const struct ieee80211_channel_range *r = &channel_range[i];
|
||||
if (r->start_freq <= chan->freq && r->end_freq >= chan->freq) {
|
||||
if (ieee80211_regdom == 64 && !ieee80211_japan_5ghz &&
|
||||
chan->freq >= 5260 && chan->freq <= 5320) {
|
||||
/*
|
||||
* Skip new channels in Japan since the
|
||||
* firmware was not marked having been upgraded
|
||||
* by the vendor.
|
||||
*/
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ieee80211_regdom == 0x10 &&
|
||||
(chan->freq == 5190 || chan->freq == 5210 ||
|
||||
chan->freq == 5230)) {
|
||||
/* Skip MKK channels when in FCC domain. */
|
||||
continue;
|
||||
}
|
||||
|
||||
chan->flag |= IEEE80211_CHAN_W_SCAN |
|
||||
IEEE80211_CHAN_W_ACTIVE_SCAN |
|
||||
IEEE80211_CHAN_W_IBSS;
|
||||
chan->power_level = r->power_level;
|
||||
chan->antenna_max = r->antenna_max;
|
||||
|
||||
if (ieee80211_regdom == 64 &&
|
||||
(chan->freq == 5170 || chan->freq == 5190 ||
|
||||
chan->freq == 5210 || chan->freq == 5230)) {
|
||||
/*
|
||||
* New regulatory rules in Japan have backwards
|
||||
* compatibility with old channels in 5.15-5.25
|
||||
* GHz band, but the station is not allowed to
|
||||
* use active scan on these old channels.
|
||||
*/
|
||||
chan->flag &= ~IEEE80211_CHAN_W_ACTIVE_SCAN;
|
||||
}
|
||||
|
||||
if (ieee80211_regdom == 64 &&
|
||||
(chan->freq == 5260 || chan->freq == 5280 ||
|
||||
chan->freq == 5300 || chan->freq == 5320)) {
|
||||
/*
|
||||
* IBSS is not allowed on 5.25-5.35 GHz band
|
||||
* due to radar detection requirements.
|
||||
*/
|
||||
chan->flag &= ~IEEE80211_CHAN_W_IBSS;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ieee80211_set_default_regdomain(struct ieee80211_hw_mode *mode)
|
||||
{
|
||||
int c;
|
||||
for (c = 0; c < mode->num_channels; c++)
|
||||
ieee80211_unmask_channel(mode->mode, &mode->channels[c]);
|
||||
}
|
||||
|
||||
|
||||
void ieee80211_regdomain_init(void)
|
||||
{
|
||||
if (ieee80211_regdom == 0x40)
|
||||
channel_range = ieee80211_mkk_channels;
|
||||
}
|
||||
|
||||
@@ -181,7 +181,7 @@ static int ct_seq_show(struct seq_file *s, void *v)
|
||||
|
||||
if (seq_printf(s, "use=%u\n", atomic_read(&conntrack->ct_general.use)))
|
||||
return -ENOSPC;
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
#include "nf_internals.h"
|
||||
|
||||
/* Internal logging interface, which relies on the real
|
||||
/* Internal logging interface, which relies on the real
|
||||
LOG target modules */
|
||||
|
||||
#define NF_LOG_PREFIXLEN 128
|
||||
|
||||
+126
-35
@@ -62,6 +62,7 @@
|
||||
#include <net/netlink.h>
|
||||
|
||||
#define NLGRPSZ(x) (ALIGN(x, sizeof(unsigned long) * 8) / 8)
|
||||
#define NLGRPLONGS(x) (NLGRPSZ(x)/sizeof(unsigned long))
|
||||
|
||||
struct netlink_sock {
|
||||
/* struct sock has to be the first member of netlink_sock */
|
||||
@@ -314,10 +315,12 @@ netlink_update_listeners(struct sock *sk)
|
||||
unsigned long mask;
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < NLGRPSZ(tbl->groups)/sizeof(unsigned long); i++) {
|
||||
for (i = 0; i < NLGRPLONGS(tbl->groups); i++) {
|
||||
mask = 0;
|
||||
sk_for_each_bound(sk, node, &tbl->mc_list)
|
||||
mask |= nlk_sk(sk)->groups[i];
|
||||
sk_for_each_bound(sk, node, &tbl->mc_list) {
|
||||
if (i < NLGRPLONGS(nlk_sk(sk)->ngroups))
|
||||
mask |= nlk_sk(sk)->groups[i];
|
||||
}
|
||||
tbl->listeners[i] = mask;
|
||||
}
|
||||
/* this function is only called with the netlink table "grabbed", which
|
||||
@@ -555,26 +558,37 @@ netlink_update_subscriptions(struct sock *sk, unsigned int subscriptions)
|
||||
nlk->subscriptions = subscriptions;
|
||||
}
|
||||
|
||||
static int netlink_alloc_groups(struct sock *sk)
|
||||
static int netlink_realloc_groups(struct sock *sk)
|
||||
{
|
||||
struct netlink_sock *nlk = nlk_sk(sk);
|
||||
unsigned int groups;
|
||||
unsigned long *new_groups;
|
||||
int err = 0;
|
||||
|
||||
netlink_lock_table();
|
||||
netlink_table_grab();
|
||||
|
||||
groups = nl_table[sk->sk_protocol].groups;
|
||||
if (!nl_table[sk->sk_protocol].registered)
|
||||
if (!nl_table[sk->sk_protocol].registered) {
|
||||
err = -ENOENT;
|
||||
netlink_unlock_table();
|
||||
goto out_unlock;
|
||||
}
|
||||
|
||||
if (err)
|
||||
return err;
|
||||
if (nlk->ngroups >= groups)
|
||||
goto out_unlock;
|
||||
|
||||
nlk->groups = kzalloc(NLGRPSZ(groups), GFP_KERNEL);
|
||||
if (nlk->groups == NULL)
|
||||
return -ENOMEM;
|
||||
new_groups = krealloc(nlk->groups, NLGRPSZ(groups), GFP_ATOMIC);
|
||||
if (new_groups == NULL) {
|
||||
err = -ENOMEM;
|
||||
goto out_unlock;
|
||||
}
|
||||
memset((char*)new_groups + NLGRPSZ(nlk->ngroups), 0,
|
||||
NLGRPSZ(groups) - NLGRPSZ(nlk->ngroups));
|
||||
|
||||
nlk->groups = new_groups;
|
||||
nlk->ngroups = groups;
|
||||
return 0;
|
||||
out_unlock:
|
||||
netlink_table_ungrab();
|
||||
return err;
|
||||
}
|
||||
|
||||
static int netlink_bind(struct socket *sock, struct sockaddr *addr, int addr_len)
|
||||
@@ -591,11 +605,9 @@ static int netlink_bind(struct socket *sock, struct sockaddr *addr, int addr_len
|
||||
if (nladdr->nl_groups) {
|
||||
if (!netlink_capable(sock, NL_NONROOT_RECV))
|
||||
return -EPERM;
|
||||
if (nlk->groups == NULL) {
|
||||
err = netlink_alloc_groups(sk);
|
||||
if (err)
|
||||
return err;
|
||||
}
|
||||
err = netlink_realloc_groups(sk);
|
||||
if (err)
|
||||
return err;
|
||||
}
|
||||
|
||||
if (nlk->pid) {
|
||||
@@ -839,10 +851,18 @@ retry:
|
||||
int netlink_has_listeners(struct sock *sk, unsigned int group)
|
||||
{
|
||||
int res = 0;
|
||||
unsigned long *listeners;
|
||||
|
||||
BUG_ON(!(nlk_sk(sk)->flags & NETLINK_KERNEL_SOCKET));
|
||||
|
||||
rcu_read_lock();
|
||||
listeners = rcu_dereference(nl_table[sk->sk_protocol].listeners);
|
||||
|
||||
if (group - 1 < nl_table[sk->sk_protocol].groups)
|
||||
res = test_bit(group - 1, nl_table[sk->sk_protocol].listeners);
|
||||
res = test_bit(group - 1, listeners);
|
||||
|
||||
rcu_read_unlock();
|
||||
|
||||
return res;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(netlink_has_listeners);
|
||||
@@ -1007,6 +1027,23 @@ void netlink_set_err(struct sock *ssk, u32 pid, u32 group, int code)
|
||||
read_unlock(&nl_table_lock);
|
||||
}
|
||||
|
||||
/* must be called with netlink table grabbed */
|
||||
static void netlink_update_socket_mc(struct netlink_sock *nlk,
|
||||
unsigned int group,
|
||||
int is_new)
|
||||
{
|
||||
int old, new = !!is_new, subscriptions;
|
||||
|
||||
old = test_bit(group - 1, nlk->groups);
|
||||
subscriptions = nlk->subscriptions - old + new;
|
||||
if (new)
|
||||
__set_bit(group - 1, nlk->groups);
|
||||
else
|
||||
__clear_bit(group - 1, nlk->groups);
|
||||
netlink_update_subscriptions(&nlk->sk, subscriptions);
|
||||
netlink_update_listeners(&nlk->sk);
|
||||
}
|
||||
|
||||
static int netlink_setsockopt(struct socket *sock, int level, int optname,
|
||||
char __user *optval, int optlen)
|
||||
{
|
||||
@@ -1032,27 +1069,16 @@ static int netlink_setsockopt(struct socket *sock, int level, int optname,
|
||||
break;
|
||||
case NETLINK_ADD_MEMBERSHIP:
|
||||
case NETLINK_DROP_MEMBERSHIP: {
|
||||
unsigned int subscriptions;
|
||||
int old, new = optname == NETLINK_ADD_MEMBERSHIP ? 1 : 0;
|
||||
|
||||
if (!netlink_capable(sock, NL_NONROOT_RECV))
|
||||
return -EPERM;
|
||||
if (nlk->groups == NULL) {
|
||||
err = netlink_alloc_groups(sk);
|
||||
if (err)
|
||||
return err;
|
||||
}
|
||||
err = netlink_realloc_groups(sk);
|
||||
if (err)
|
||||
return err;
|
||||
if (!val || val - 1 >= nlk->ngroups)
|
||||
return -EINVAL;
|
||||
netlink_table_grab();
|
||||
old = test_bit(val - 1, nlk->groups);
|
||||
subscriptions = nlk->subscriptions - old + new;
|
||||
if (new)
|
||||
__set_bit(val - 1, nlk->groups);
|
||||
else
|
||||
__clear_bit(val - 1, nlk->groups);
|
||||
netlink_update_subscriptions(sk, subscriptions);
|
||||
netlink_update_listeners(sk);
|
||||
netlink_update_socket_mc(nlk, val,
|
||||
optname == NETLINK_ADD_MEMBERSHIP);
|
||||
netlink_table_ungrab();
|
||||
err = 0;
|
||||
break;
|
||||
@@ -1328,6 +1354,71 @@ out_sock_release:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* netlink_change_ngroups - change number of multicast groups
|
||||
*
|
||||
* This changes the number of multicast groups that are available
|
||||
* on a certain netlink family. Note that it is not possible to
|
||||
* change the number of groups to below 32. Also note that it does
|
||||
* not implicitly call netlink_clear_multicast_users() when the
|
||||
* number of groups is reduced.
|
||||
*
|
||||
* @sk: The kernel netlink socket, as returned by netlink_kernel_create().
|
||||
* @groups: The new number of groups.
|
||||
*/
|
||||
int netlink_change_ngroups(struct sock *sk, unsigned int groups)
|
||||
{
|
||||
unsigned long *listeners, *old = NULL;
|
||||
struct netlink_table *tbl = &nl_table[sk->sk_protocol];
|
||||
int err = 0;
|
||||
|
||||
if (groups < 32)
|
||||
groups = 32;
|
||||
|
||||
netlink_table_grab();
|
||||
if (NLGRPSZ(tbl->groups) < NLGRPSZ(groups)) {
|
||||
listeners = kzalloc(NLGRPSZ(groups), GFP_ATOMIC);
|
||||
if (!listeners) {
|
||||
err = -ENOMEM;
|
||||
goto out_ungrab;
|
||||
}
|
||||
old = tbl->listeners;
|
||||
memcpy(listeners, old, NLGRPSZ(tbl->groups));
|
||||
rcu_assign_pointer(tbl->listeners, listeners);
|
||||
}
|
||||
tbl->groups = groups;
|
||||
|
||||
out_ungrab:
|
||||
netlink_table_ungrab();
|
||||
synchronize_rcu();
|
||||
kfree(old);
|
||||
return err;
|
||||
}
|
||||
EXPORT_SYMBOL(netlink_change_ngroups);
|
||||
|
||||
/**
|
||||
* netlink_clear_multicast_users - kick off multicast listeners
|
||||
*
|
||||
* This function removes all listeners from the given group.
|
||||
* @ksk: The kernel netlink socket, as returned by
|
||||
* netlink_kernel_create().
|
||||
* @group: The multicast group to clear.
|
||||
*/
|
||||
void netlink_clear_multicast_users(struct sock *ksk, unsigned int group)
|
||||
{
|
||||
struct sock *sk;
|
||||
struct hlist_node *node;
|
||||
struct netlink_table *tbl = &nl_table[ksk->sk_protocol];
|
||||
|
||||
netlink_table_grab();
|
||||
|
||||
sk_for_each_bound(sk, node, &tbl->mc_list)
|
||||
netlink_update_socket_mc(nlk_sk(sk), group, 0);
|
||||
|
||||
netlink_table_ungrab();
|
||||
}
|
||||
EXPORT_SYMBOL(netlink_clear_multicast_users);
|
||||
|
||||
void netlink_set_nonroot(int protocol, unsigned int flags)
|
||||
{
|
||||
if ((unsigned int)protocol < MAX_LINKS)
|
||||
|
||||
+228
-7
@@ -3,6 +3,7 @@
|
||||
*
|
||||
* Authors: Jamal Hadi Salim
|
||||
* Thomas Graf <tgraf@suug.ch>
|
||||
* Johannes Berg <johannes@sipsolutions.net>
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
@@ -13,6 +14,7 @@
|
||||
#include <linux/string.h>
|
||||
#include <linux/skbuff.h>
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/bitmap.h>
|
||||
#include <net/sock.h>
|
||||
#include <net/genetlink.h>
|
||||
|
||||
@@ -42,6 +44,16 @@ static void genl_unlock(void)
|
||||
#define GENL_FAM_TAB_MASK (GENL_FAM_TAB_SIZE - 1)
|
||||
|
||||
static struct list_head family_ht[GENL_FAM_TAB_SIZE];
|
||||
/*
|
||||
* Bitmap of multicast groups that are currently in use.
|
||||
*
|
||||
* To avoid an allocation at boot of just one unsigned long,
|
||||
* declare it global instead.
|
||||
* Bit 0 is marked as already used since group 0 is invalid.
|
||||
*/
|
||||
static unsigned long mc_group_start = 0x1;
|
||||
static unsigned long *mc_groups = &mc_group_start;
|
||||
static unsigned long mc_groups_longs = 1;
|
||||
|
||||
static int genl_ctrl_event(int event, void *data);
|
||||
|
||||
@@ -116,6 +128,114 @@ static inline u16 genl_generate_id(void)
|
||||
return id_gen_idx;
|
||||
}
|
||||
|
||||
static struct genl_multicast_group notify_grp;
|
||||
|
||||
/**
|
||||
* genl_register_mc_group - register a multicast group
|
||||
*
|
||||
* Registers the specified multicast group and notifies userspace
|
||||
* about the new group.
|
||||
*
|
||||
* Returns 0 on success or a negative error code.
|
||||
*
|
||||
* @family: The generic netlink family the group shall be registered for.
|
||||
* @grp: The group to register, must have a name.
|
||||
*/
|
||||
int genl_register_mc_group(struct genl_family *family,
|
||||
struct genl_multicast_group *grp)
|
||||
{
|
||||
int id;
|
||||
unsigned long *new_groups;
|
||||
int err;
|
||||
|
||||
BUG_ON(grp->name[0] == '\0');
|
||||
|
||||
genl_lock();
|
||||
|
||||
/* special-case our own group */
|
||||
if (grp == ¬ify_grp)
|
||||
id = GENL_ID_CTRL;
|
||||
else
|
||||
id = find_first_zero_bit(mc_groups,
|
||||
mc_groups_longs * BITS_PER_LONG);
|
||||
|
||||
|
||||
if (id >= mc_groups_longs * BITS_PER_LONG) {
|
||||
size_t nlen = (mc_groups_longs + 1) * sizeof(unsigned long);
|
||||
|
||||
if (mc_groups == &mc_group_start) {
|
||||
new_groups = kzalloc(nlen, GFP_KERNEL);
|
||||
if (!new_groups) {
|
||||
err = -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
mc_groups = new_groups;
|
||||
*mc_groups = mc_group_start;
|
||||
} else {
|
||||
new_groups = krealloc(mc_groups, nlen, GFP_KERNEL);
|
||||
if (!new_groups) {
|
||||
err = -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
mc_groups = new_groups;
|
||||
mc_groups[mc_groups_longs] = 0;
|
||||
}
|
||||
mc_groups_longs++;
|
||||
}
|
||||
|
||||
err = netlink_change_ngroups(genl_sock,
|
||||
sizeof(unsigned long) * NETLINK_GENERIC);
|
||||
if (err)
|
||||
goto out;
|
||||
|
||||
grp->id = id;
|
||||
set_bit(id, mc_groups);
|
||||
list_add_tail(&grp->list, &family->mcast_groups);
|
||||
grp->family = family;
|
||||
|
||||
genl_ctrl_event(CTRL_CMD_NEWMCAST_GRP, grp);
|
||||
out:
|
||||
genl_unlock();
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(genl_register_mc_group);
|
||||
|
||||
/**
|
||||
* genl_unregister_mc_group - unregister a multicast group
|
||||
*
|
||||
* Unregisters the specified multicast group and notifies userspace
|
||||
* about it. All current listeners on the group are removed.
|
||||
*
|
||||
* Note: It is not necessary to unregister all multicast groups before
|
||||
* unregistering the family, unregistering the family will cause
|
||||
* all assigned multicast groups to be unregistered automatically.
|
||||
*
|
||||
* @family: Generic netlink family the group belongs to.
|
||||
* @grp: The group to unregister, must have been registered successfully
|
||||
* previously.
|
||||
*/
|
||||
void genl_unregister_mc_group(struct genl_family *family,
|
||||
struct genl_multicast_group *grp)
|
||||
{
|
||||
BUG_ON(grp->family != family);
|
||||
genl_lock();
|
||||
netlink_clear_multicast_users(genl_sock, grp->id);
|
||||
clear_bit(grp->id, mc_groups);
|
||||
list_del(&grp->list);
|
||||
genl_ctrl_event(CTRL_CMD_DELMCAST_GRP, grp);
|
||||
grp->id = 0;
|
||||
grp->family = NULL;
|
||||
genl_unlock();
|
||||
}
|
||||
|
||||
static void genl_unregister_mc_groups(struct genl_family *family)
|
||||
{
|
||||
struct genl_multicast_group *grp, *tmp;
|
||||
|
||||
list_for_each_entry_safe(grp, tmp, &family->mcast_groups, list)
|
||||
genl_unregister_mc_group(family, grp);
|
||||
}
|
||||
|
||||
/**
|
||||
* genl_register_ops - register generic netlink operations
|
||||
* @family: generic netlink family
|
||||
@@ -216,6 +336,7 @@ int genl_register_family(struct genl_family *family)
|
||||
goto errout;
|
||||
|
||||
INIT_LIST_HEAD(&family->ops_list);
|
||||
INIT_LIST_HEAD(&family->mcast_groups);
|
||||
|
||||
genl_lock();
|
||||
|
||||
@@ -275,6 +396,8 @@ int genl_unregister_family(struct genl_family *family)
|
||||
{
|
||||
struct genl_family *rc;
|
||||
|
||||
genl_unregister_mc_groups(family);
|
||||
|
||||
genl_lock();
|
||||
|
||||
list_for_each_entry(rc, genl_family_chain(family->id), family_list) {
|
||||
@@ -410,6 +533,67 @@ static int ctrl_fill_info(struct genl_family *family, u32 pid, u32 seq,
|
||||
nla_nest_end(skb, nla_ops);
|
||||
}
|
||||
|
||||
if (!list_empty(&family->mcast_groups)) {
|
||||
struct genl_multicast_group *grp;
|
||||
struct nlattr *nla_grps;
|
||||
int idx = 1;
|
||||
|
||||
nla_grps = nla_nest_start(skb, CTRL_ATTR_MCAST_GROUPS);
|
||||
if (nla_grps == NULL)
|
||||
goto nla_put_failure;
|
||||
|
||||
list_for_each_entry(grp, &family->mcast_groups, list) {
|
||||
struct nlattr *nest;
|
||||
|
||||
nest = nla_nest_start(skb, idx++);
|
||||
if (nest == NULL)
|
||||
goto nla_put_failure;
|
||||
|
||||
NLA_PUT_U32(skb, CTRL_ATTR_MCAST_GRP_ID, grp->id);
|
||||
NLA_PUT_STRING(skb, CTRL_ATTR_MCAST_GRP_NAME,
|
||||
grp->name);
|
||||
|
||||
nla_nest_end(skb, nest);
|
||||
}
|
||||
nla_nest_end(skb, nla_grps);
|
||||
}
|
||||
|
||||
return genlmsg_end(skb, hdr);
|
||||
|
||||
nla_put_failure:
|
||||
return genlmsg_cancel(skb, hdr);
|
||||
}
|
||||
|
||||
static int ctrl_fill_mcgrp_info(struct genl_multicast_group *grp, u32 pid,
|
||||
u32 seq, u32 flags, struct sk_buff *skb,
|
||||
u8 cmd)
|
||||
{
|
||||
void *hdr;
|
||||
struct nlattr *nla_grps;
|
||||
struct nlattr *nest;
|
||||
|
||||
hdr = genlmsg_put(skb, pid, seq, &genl_ctrl, flags, cmd);
|
||||
if (hdr == NULL)
|
||||
return -1;
|
||||
|
||||
NLA_PUT_STRING(skb, CTRL_ATTR_FAMILY_NAME, grp->family->name);
|
||||
NLA_PUT_U16(skb, CTRL_ATTR_FAMILY_ID, grp->family->id);
|
||||
|
||||
nla_grps = nla_nest_start(skb, CTRL_ATTR_MCAST_GROUPS);
|
||||
if (nla_grps == NULL)
|
||||
goto nla_put_failure;
|
||||
|
||||
nest = nla_nest_start(skb, 1);
|
||||
if (nest == NULL)
|
||||
goto nla_put_failure;
|
||||
|
||||
NLA_PUT_U32(skb, CTRL_ATTR_MCAST_GRP_ID, grp->id);
|
||||
NLA_PUT_STRING(skb, CTRL_ATTR_MCAST_GRP_NAME,
|
||||
grp->name);
|
||||
|
||||
nla_nest_end(skb, nest);
|
||||
nla_nest_end(skb, nla_grps);
|
||||
|
||||
return genlmsg_end(skb, hdr);
|
||||
|
||||
nla_put_failure:
|
||||
@@ -453,8 +637,8 @@ errout:
|
||||
return skb->len;
|
||||
}
|
||||
|
||||
static struct sk_buff *ctrl_build_msg(struct genl_family *family, u32 pid,
|
||||
int seq, u8 cmd)
|
||||
static struct sk_buff *ctrl_build_family_msg(struct genl_family *family,
|
||||
u32 pid, int seq, u8 cmd)
|
||||
{
|
||||
struct sk_buff *skb;
|
||||
int err;
|
||||
@@ -472,6 +656,25 @@ static struct sk_buff *ctrl_build_msg(struct genl_family *family, u32 pid,
|
||||
return skb;
|
||||
}
|
||||
|
||||
static struct sk_buff *ctrl_build_mcgrp_msg(struct genl_multicast_group *grp,
|
||||
u32 pid, int seq, u8 cmd)
|
||||
{
|
||||
struct sk_buff *skb;
|
||||
int err;
|
||||
|
||||
skb = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
|
||||
if (skb == NULL)
|
||||
return ERR_PTR(-ENOBUFS);
|
||||
|
||||
err = ctrl_fill_mcgrp_info(grp, pid, seq, 0, skb, cmd);
|
||||
if (err < 0) {
|
||||
nlmsg_free(skb);
|
||||
return ERR_PTR(err);
|
||||
}
|
||||
|
||||
return skb;
|
||||
}
|
||||
|
||||
static const struct nla_policy ctrl_policy[CTRL_ATTR_MAX+1] = {
|
||||
[CTRL_ATTR_FAMILY_ID] = { .type = NLA_U16 },
|
||||
[CTRL_ATTR_FAMILY_NAME] = { .type = NLA_NUL_STRING,
|
||||
@@ -501,8 +704,8 @@ static int ctrl_getfamily(struct sk_buff *skb, struct genl_info *info)
|
||||
goto errout;
|
||||
}
|
||||
|
||||
msg = ctrl_build_msg(res, info->snd_pid, info->snd_seq,
|
||||
CTRL_CMD_NEWFAMILY);
|
||||
msg = ctrl_build_family_msg(res, info->snd_pid, info->snd_seq,
|
||||
CTRL_CMD_NEWFAMILY);
|
||||
if (IS_ERR(msg)) {
|
||||
err = PTR_ERR(msg);
|
||||
goto errout;
|
||||
@@ -523,7 +726,15 @@ static int genl_ctrl_event(int event, void *data)
|
||||
switch (event) {
|
||||
case CTRL_CMD_NEWFAMILY:
|
||||
case CTRL_CMD_DELFAMILY:
|
||||
msg = ctrl_build_msg(data, 0, 0, event);
|
||||
msg = ctrl_build_family_msg(data, 0, 0, event);
|
||||
if (IS_ERR(msg))
|
||||
return PTR_ERR(msg);
|
||||
|
||||
genlmsg_multicast(msg, 0, GENL_ID_CTRL, GFP_KERNEL);
|
||||
break;
|
||||
case CTRL_CMD_NEWMCAST_GRP:
|
||||
case CTRL_CMD_DELMCAST_GRP:
|
||||
msg = ctrl_build_mcgrp_msg(data, 0, 0, event);
|
||||
if (IS_ERR(msg))
|
||||
return PTR_ERR(msg);
|
||||
|
||||
@@ -541,6 +752,10 @@ static struct genl_ops genl_ctrl_ops = {
|
||||
.policy = ctrl_policy,
|
||||
};
|
||||
|
||||
static struct genl_multicast_group notify_grp = {
|
||||
.name = "notify",
|
||||
};
|
||||
|
||||
static int __init genl_init(void)
|
||||
{
|
||||
int i, err;
|
||||
@@ -557,11 +772,17 @@ static int __init genl_init(void)
|
||||
goto errout_register;
|
||||
|
||||
netlink_set_nonroot(NETLINK_GENERIC, NL_NONROOT_RECV);
|
||||
genl_sock = netlink_kernel_create(NETLINK_GENERIC, GENL_MAX_ID,
|
||||
genl_rcv, NULL, THIS_MODULE);
|
||||
|
||||
/* we'll bump the group number right afterwards */
|
||||
genl_sock = netlink_kernel_create(NETLINK_GENERIC, 0, genl_rcv,
|
||||
NULL, THIS_MODULE);
|
||||
if (genl_sock == NULL)
|
||||
panic("GENL: Cannot initialize generic netlink\n");
|
||||
|
||||
err = genl_register_mc_group(&genl_ctrl, ¬ify_grp);
|
||||
if (err < 0)
|
||||
goto errout_register;
|
||||
|
||||
return 0;
|
||||
|
||||
errout_register:
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user