Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (26 commits) pkt_sched: Fix lockdep warning on est_tree_lock in gen_estimator ipvs: avoid oops for passive FTP Revert "sky2: don't do GRO on second port" gro: fix different skb headrooms bridge: Clear INET control block of SKBs passed into ip_fragment(). 3c59x: Remove incorrect locking; correct documented lock hierarchy sky2: don't do GRO on second port ipv4: minor fix about RPF in help of Kconfig xfrm_user: avoid a warning with some compiler net/sched/sch_hfsc.c: initialize parent's cl_cfmin properly in init_vf() pxa168_eth: fix a mdiobus leak net sched: fix kernel leak in act_police vhost: stop worker only if created MAINTAINERS: Add ehea driver as Supported ath9k_hw: fix parsing of HT40 5 GHz CTLs ath9k_hw: Fix EEPROM uncompress block reading on AR9003 wireless: register wiphy rfkill w/o holding cfg80211_mutex netlink: Make NETLINK_USERSOCK work again. irda: Correctly clean up self->ias_obj on irda_bind() failure. wireless extensions: fix kernel heap content leak ...
此提交包含在:
@@ -761,9 +761,11 @@ static int br_nf_dev_queue_xmit(struct sk_buff *skb)
|
||||
{
|
||||
if (skb->nfct != NULL && skb->protocol == htons(ETH_P_IP) &&
|
||||
skb->len + nf_bridge_mtu_reduction(skb) > skb->dev->mtu &&
|
||||
!skb_is_gso(skb))
|
||||
!skb_is_gso(skb)) {
|
||||
/* BUG: Should really parse the IP options here. */
|
||||
memset(IPCB(skb), 0, sizeof(struct inet_skb_parm));
|
||||
return ip_fragment(skb, br_dev_queue_push_xmit);
|
||||
else
|
||||
} else
|
||||
return br_dev_queue_push_xmit(skb);
|
||||
}
|
||||
#else
|
||||
|
@@ -232,7 +232,7 @@ int gen_new_estimator(struct gnet_stats_basic_packed *bstats,
|
||||
est->last_packets = bstats->packets;
|
||||
est->avpps = rate_est->pps<<10;
|
||||
|
||||
spin_lock(&est_tree_lock);
|
||||
spin_lock_bh(&est_tree_lock);
|
||||
if (!elist[idx].timer.function) {
|
||||
INIT_LIST_HEAD(&elist[idx].list);
|
||||
setup_timer(&elist[idx].timer, est_timer, idx);
|
||||
@@ -243,7 +243,7 @@ int gen_new_estimator(struct gnet_stats_basic_packed *bstats,
|
||||
|
||||
list_add_rcu(&est->list, &elist[idx].list);
|
||||
gen_add_node(est);
|
||||
spin_unlock(&est_tree_lock);
|
||||
spin_unlock_bh(&est_tree_lock);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -270,7 +270,7 @@ void gen_kill_estimator(struct gnet_stats_basic_packed *bstats,
|
||||
{
|
||||
struct gen_estimator *e;
|
||||
|
||||
spin_lock(&est_tree_lock);
|
||||
spin_lock_bh(&est_tree_lock);
|
||||
while ((e = gen_find_node(bstats, rate_est))) {
|
||||
rb_erase(&e->node, &est_root);
|
||||
|
||||
@@ -281,7 +281,7 @@ void gen_kill_estimator(struct gnet_stats_basic_packed *bstats,
|
||||
list_del_rcu(&e->list);
|
||||
call_rcu(&e->e_rcu, __gen_kill_estimator);
|
||||
}
|
||||
spin_unlock(&est_tree_lock);
|
||||
spin_unlock_bh(&est_tree_lock);
|
||||
}
|
||||
EXPORT_SYMBOL(gen_kill_estimator);
|
||||
|
||||
@@ -320,9 +320,9 @@ bool gen_estimator_active(const struct gnet_stats_basic_packed *bstats,
|
||||
|
||||
ASSERT_RTNL();
|
||||
|
||||
spin_lock(&est_tree_lock);
|
||||
spin_lock_bh(&est_tree_lock);
|
||||
res = gen_find_node(bstats, rate_est) != NULL;
|
||||
spin_unlock(&est_tree_lock);
|
||||
spin_unlock_bh(&est_tree_lock);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
@@ -2573,6 +2573,10 @@ struct sk_buff *skb_segment(struct sk_buff *skb, int features)
|
||||
__copy_skb_header(nskb, skb);
|
||||
nskb->mac_len = skb->mac_len;
|
||||
|
||||
/* nskb and skb might have different headroom */
|
||||
if (nskb->ip_summed == CHECKSUM_PARTIAL)
|
||||
nskb->csum_start += skb_headroom(nskb) - headroom;
|
||||
|
||||
skb_reset_mac_header(nskb);
|
||||
skb_set_network_header(nskb, skb->mac_len);
|
||||
nskb->transport_header = (nskb->network_header +
|
||||
@@ -2702,8 +2706,8 @@ int skb_gro_receive(struct sk_buff **head, struct sk_buff *skb)
|
||||
} else if (skb_gro_len(p) != pinfo->gso_size)
|
||||
return -E2BIG;
|
||||
|
||||
headroom = skb_headroom(p);
|
||||
nskb = netdev_alloc_skb(p->dev, headroom + skb_gro_offset(p));
|
||||
headroom = NET_SKB_PAD + NET_IP_ALIGN;
|
||||
nskb = alloc_skb(headroom + skb_gro_offset(p), GFP_ATOMIC);
|
||||
if (unlikely(!nskb))
|
||||
return -ENOMEM;
|
||||
|
||||
|
@@ -46,7 +46,7 @@ config IP_ADVANCED_ROUTER
|
||||
rp_filter on use:
|
||||
|
||||
echo 1 > /proc/sys/net/ipv4/conf/<device>/rp_filter
|
||||
and
|
||||
or
|
||||
echo 1 > /proc/sys/net/ipv4/conf/all/rp_filter
|
||||
|
||||
Note that some distributions enable it in startup scripts.
|
||||
|
@@ -824,8 +824,8 @@ static int irda_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
|
||||
|
||||
err = irda_open_tsap(self, addr->sir_lsap_sel, addr->sir_name);
|
||||
if (err < 0) {
|
||||
kfree(self->ias_obj->name);
|
||||
kfree(self->ias_obj);
|
||||
irias_delete_object(self->ias_obj);
|
||||
self->ias_obj = NULL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
@@ -732,6 +732,12 @@ void ieee80211_unregister_hw(struct ieee80211_hw *hw)
|
||||
|
||||
rtnl_unlock();
|
||||
|
||||
/*
|
||||
* Now all work items will be gone, but the
|
||||
* timer might still be armed, so delete it
|
||||
*/
|
||||
del_timer_sync(&local->work_timer);
|
||||
|
||||
cancel_work_sync(&local->reconfig_filter);
|
||||
|
||||
ieee80211_clear_tx_pending(local);
|
||||
|
@@ -45,6 +45,7 @@
|
||||
#include <linux/netfilter.h>
|
||||
#include <net/netfilter/nf_conntrack.h>
|
||||
#include <net/netfilter/nf_conntrack_expect.h>
|
||||
#include <net/netfilter/nf_nat.h>
|
||||
#include <net/netfilter/nf_nat_helper.h>
|
||||
#include <linux/gfp.h>
|
||||
#include <net/protocol.h>
|
||||
@@ -359,7 +360,7 @@ static int ip_vs_ftp_out(struct ip_vs_app *app, struct ip_vs_conn *cp,
|
||||
buf_len = strlen(buf);
|
||||
|
||||
ct = nf_ct_get(skb, &ctinfo);
|
||||
if (ct && !nf_ct_is_untracked(ct)) {
|
||||
if (ct && !nf_ct_is_untracked(ct) && nfct_nat(ct)) {
|
||||
/* If mangling fails this function will return 0
|
||||
* which will cause the packet to be dropped.
|
||||
* Mangling can only fail under memory pressure,
|
||||
|
@@ -2102,6 +2102,26 @@ static void __net_exit netlink_net_exit(struct net *net)
|
||||
#endif
|
||||
}
|
||||
|
||||
static void __init netlink_add_usersock_entry(void)
|
||||
{
|
||||
unsigned long *listeners;
|
||||
int groups = 32;
|
||||
|
||||
listeners = kzalloc(NLGRPSZ(groups) + sizeof(struct listeners_rcu_head),
|
||||
GFP_KERNEL);
|
||||
if (!listeners)
|
||||
panic("netlink_add_usersock_entry: Cannot allocate listneres\n");
|
||||
|
||||
netlink_table_grab();
|
||||
|
||||
nl_table[NETLINK_USERSOCK].groups = groups;
|
||||
nl_table[NETLINK_USERSOCK].listeners = listeners;
|
||||
nl_table[NETLINK_USERSOCK].module = THIS_MODULE;
|
||||
nl_table[NETLINK_USERSOCK].registered = 1;
|
||||
|
||||
netlink_table_ungrab();
|
||||
}
|
||||
|
||||
static struct pernet_operations __net_initdata netlink_net_ops = {
|
||||
.init = netlink_net_init,
|
||||
.exit = netlink_net_exit,
|
||||
@@ -2150,6 +2170,8 @@ static int __init netlink_proto_init(void)
|
||||
hash->rehash_time = jiffies;
|
||||
}
|
||||
|
||||
netlink_add_usersock_entry();
|
||||
|
||||
sock_register(&netlink_family_ops);
|
||||
register_pernet_subsys(&netlink_net_ops);
|
||||
/* The netlink device handler may be needed early. */
|
||||
|
@@ -350,22 +350,19 @@ tcf_act_police_dump(struct sk_buff *skb, struct tc_action *a, int bind, int ref)
|
||||
{
|
||||
unsigned char *b = skb_tail_pointer(skb);
|
||||
struct tcf_police *police = a->priv;
|
||||
struct tc_police opt;
|
||||
struct tc_police opt = {
|
||||
.index = police->tcf_index,
|
||||
.action = police->tcf_action,
|
||||
.mtu = police->tcfp_mtu,
|
||||
.burst = police->tcfp_burst,
|
||||
.refcnt = police->tcf_refcnt - ref,
|
||||
.bindcnt = police->tcf_bindcnt - bind,
|
||||
};
|
||||
|
||||
opt.index = police->tcf_index;
|
||||
opt.action = police->tcf_action;
|
||||
opt.mtu = police->tcfp_mtu;
|
||||
opt.burst = police->tcfp_burst;
|
||||
opt.refcnt = police->tcf_refcnt - ref;
|
||||
opt.bindcnt = police->tcf_bindcnt - bind;
|
||||
if (police->tcfp_R_tab)
|
||||
opt.rate = police->tcfp_R_tab->rate;
|
||||
else
|
||||
memset(&opt.rate, 0, sizeof(opt.rate));
|
||||
if (police->tcfp_P_tab)
|
||||
opt.peakrate = police->tcfp_P_tab->rate;
|
||||
else
|
||||
memset(&opt.peakrate, 0, sizeof(opt.peakrate));
|
||||
NLA_PUT(skb, TCA_POLICE_TBF, sizeof(opt), &opt);
|
||||
if (police->tcfp_result)
|
||||
NLA_PUT_U32(skb, TCA_POLICE_RESULT, police->tcfp_result);
|
||||
|
@@ -761,8 +761,8 @@ init_vf(struct hfsc_class *cl, unsigned int len)
|
||||
if (f != cl->cl_f) {
|
||||
cl->cl_f = f;
|
||||
cftree_update(cl);
|
||||
update_cfmin(cl->cl_parent);
|
||||
}
|
||||
update_cfmin(cl->cl_parent);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -475,12 +475,10 @@ int wiphy_register(struct wiphy *wiphy)
|
||||
mutex_lock(&cfg80211_mutex);
|
||||
|
||||
res = device_add(&rdev->wiphy.dev);
|
||||
if (res)
|
||||
goto out_unlock;
|
||||
|
||||
res = rfkill_register(rdev->rfkill);
|
||||
if (res)
|
||||
goto out_rm_dev;
|
||||
if (res) {
|
||||
mutex_unlock(&cfg80211_mutex);
|
||||
return res;
|
||||
}
|
||||
|
||||
/* set up regulatory info */
|
||||
wiphy_update_regulatory(wiphy, NL80211_REGDOM_SET_BY_CORE);
|
||||
@@ -509,13 +507,18 @@ int wiphy_register(struct wiphy *wiphy)
|
||||
cfg80211_debugfs_rdev_add(rdev);
|
||||
mutex_unlock(&cfg80211_mutex);
|
||||
|
||||
/*
|
||||
* due to a locking dependency this has to be outside of the
|
||||
* cfg80211_mutex lock
|
||||
*/
|
||||
res = rfkill_register(rdev->rfkill);
|
||||
if (res)
|
||||
goto out_rm_dev;
|
||||
|
||||
return 0;
|
||||
|
||||
out_rm_dev:
|
||||
device_del(&rdev->wiphy.dev);
|
||||
|
||||
out_unlock:
|
||||
mutex_unlock(&cfg80211_mutex);
|
||||
return res;
|
||||
}
|
||||
EXPORT_SYMBOL(wiphy_register);
|
||||
|
@@ -1420,6 +1420,9 @@ int cfg80211_wext_giwessid(struct net_device *dev,
|
||||
{
|
||||
struct wireless_dev *wdev = dev->ieee80211_ptr;
|
||||
|
||||
data->flags = 0;
|
||||
data->length = 0;
|
||||
|
||||
switch (wdev->iftype) {
|
||||
case NL80211_IFTYPE_ADHOC:
|
||||
return cfg80211_ibss_wext_giwessid(dev, info, data, ssid);
|
||||
|
@@ -782,6 +782,22 @@ static int ioctl_standard_iw_point(struct iw_point *iwp, unsigned int cmd,
|
||||
}
|
||||
}
|
||||
|
||||
if (IW_IS_GET(cmd) && !(descr->flags & IW_DESCR_FLAG_NOMAX)) {
|
||||
/*
|
||||
* If this is a GET, but not NOMAX, it means that the extra
|
||||
* data is not bounded by userspace, but by max_tokens. Thus
|
||||
* set the length to max_tokens. This matches the extra data
|
||||
* allocation.
|
||||
* The driver should fill it with the number of tokens it
|
||||
* provided, and it may check iwp->length rather than having
|
||||
* knowledge of max_tokens. If the driver doesn't change the
|
||||
* iwp->length, this ioctl just copies back max_token tokens
|
||||
* filled with zeroes. Hopefully the driver isn't claiming
|
||||
* them to be valid data.
|
||||
*/
|
||||
iwp->length = descr->max_tokens;
|
||||
}
|
||||
|
||||
err = handler(dev, info, (union iwreq_data *) iwp, extra);
|
||||
|
||||
iwp->length += essid_compat;
|
||||
|
@@ -1801,7 +1801,7 @@ static int xfrm_add_sa_expire(struct sk_buff *skb, struct nlmsghdr *nlh,
|
||||
struct xfrm_user_expire *ue = nlmsg_data(nlh);
|
||||
struct xfrm_usersa_info *p = &ue->state;
|
||||
struct xfrm_mark m;
|
||||
u32 mark = xfrm_mark_get(attrs, &m);;
|
||||
u32 mark = xfrm_mark_get(attrs, &m);
|
||||
|
||||
x = xfrm_state_lookup(net, mark, &p->id.daddr, p->id.spi, p->id.proto, p->family);
|
||||
|
||||
|
新增問題並參考
封鎖使用者