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 git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts: drivers/net/ethernet/cavium/Kconfig The cavium conflict was overlapping dependency changes. Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
@@ -1138,6 +1138,9 @@ void batadv_dat_snoop_outgoing_arp_reply(struct batadv_priv *bat_priv,
|
||||
* @bat_priv: the bat priv with all the soft interface information
|
||||
* @skb: packet to check
|
||||
* @hdr_size: size of the encapsulation header
|
||||
*
|
||||
* Returns true if the packet was snooped and consumed by DAT. False if the
|
||||
* packet has to be delivered to the interface
|
||||
*/
|
||||
bool batadv_dat_snoop_incoming_arp_reply(struct batadv_priv *bat_priv,
|
||||
struct sk_buff *skb, int hdr_size)
|
||||
@@ -1145,7 +1148,7 @@ bool batadv_dat_snoop_incoming_arp_reply(struct batadv_priv *bat_priv,
|
||||
uint16_t type;
|
||||
__be32 ip_src, ip_dst;
|
||||
uint8_t *hw_src, *hw_dst;
|
||||
bool ret = false;
|
||||
bool dropped = false;
|
||||
unsigned short vid;
|
||||
|
||||
if (!atomic_read(&bat_priv->distributed_arp_table))
|
||||
@@ -1174,12 +1177,17 @@ bool batadv_dat_snoop_incoming_arp_reply(struct batadv_priv *bat_priv,
|
||||
/* if this REPLY is directed to a client of mine, let's deliver the
|
||||
* packet to the interface
|
||||
*/
|
||||
ret = !batadv_is_my_client(bat_priv, hw_dst, vid);
|
||||
dropped = !batadv_is_my_client(bat_priv, hw_dst, vid);
|
||||
|
||||
/* if this REPLY is sent on behalf of a client of mine, let's drop the
|
||||
* packet because the client will reply by itself
|
||||
*/
|
||||
dropped |= batadv_is_my_client(bat_priv, hw_src, vid);
|
||||
out:
|
||||
if (ret)
|
||||
if (dropped)
|
||||
kfree_skb(skb);
|
||||
/* if ret == false -> packet has to be delivered to the interface */
|
||||
return ret;
|
||||
/* if dropped == false -> deliver to the interface */
|
||||
return dropped;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -439,6 +439,8 @@ static void batadv_gw_node_add(struct batadv_priv *bat_priv,
|
||||
|
||||
INIT_HLIST_NODE(&gw_node->list);
|
||||
gw_node->orig_node = orig_node;
|
||||
gw_node->bandwidth_down = ntohl(gateway->bandwidth_down);
|
||||
gw_node->bandwidth_up = ntohl(gateway->bandwidth_up);
|
||||
atomic_set(&gw_node->refcount, 1);
|
||||
|
||||
spin_lock_bh(&bat_priv->gw.list_lock);
|
||||
|
||||
@@ -479,6 +479,9 @@ out:
|
||||
*/
|
||||
void batadv_softif_vlan_free_ref(struct batadv_softif_vlan *vlan)
|
||||
{
|
||||
if (!vlan)
|
||||
return;
|
||||
|
||||
if (atomic_dec_and_test(&vlan->refcount)) {
|
||||
spin_lock_bh(&vlan->bat_priv->softif_vlan_list_lock);
|
||||
hlist_del_rcu(&vlan->list);
|
||||
|
||||
@@ -594,6 +594,9 @@ bool batadv_tt_local_add(struct net_device *soft_iface, const uint8_t *addr,
|
||||
|
||||
/* increase the refcounter of the related vlan */
|
||||
vlan = batadv_softif_vlan_get(bat_priv, vid);
|
||||
if (WARN(!vlan, "adding TT local entry %pM to non-existent VLAN %d",
|
||||
addr, BATADV_PRINT_VID(vid)))
|
||||
goto out;
|
||||
|
||||
batadv_dbg(BATADV_DBG_TT, bat_priv,
|
||||
"Creating new local tt entry: %pM (vid: %d, ttvn: %d)\n",
|
||||
@@ -1034,6 +1037,7 @@ uint16_t batadv_tt_local_remove(struct batadv_priv *bat_priv,
|
||||
struct batadv_tt_local_entry *tt_local_entry;
|
||||
uint16_t flags, curr_flags = BATADV_NO_FLAGS;
|
||||
struct batadv_softif_vlan *vlan;
|
||||
void *tt_entry_exists;
|
||||
|
||||
tt_local_entry = batadv_tt_local_hash_find(bat_priv, addr, vid);
|
||||
if (!tt_local_entry)
|
||||
@@ -1061,11 +1065,22 @@ uint16_t batadv_tt_local_remove(struct batadv_priv *bat_priv,
|
||||
* immediately purge it
|
||||
*/
|
||||
batadv_tt_local_event(bat_priv, tt_local_entry, BATADV_TT_CLIENT_DEL);
|
||||
hlist_del_rcu(&tt_local_entry->common.hash_entry);
|
||||
|
||||
tt_entry_exists = batadv_hash_remove(bat_priv->tt.local_hash,
|
||||
batadv_compare_tt,
|
||||
batadv_choose_tt,
|
||||
&tt_local_entry->common);
|
||||
if (!tt_entry_exists)
|
||||
goto out;
|
||||
|
||||
/* extra call to free the local tt entry */
|
||||
batadv_tt_local_entry_free_ref(tt_local_entry);
|
||||
|
||||
/* decrease the reference held for this vlan */
|
||||
vlan = batadv_softif_vlan_get(bat_priv, vid);
|
||||
if (!vlan)
|
||||
goto out;
|
||||
|
||||
batadv_softif_vlan_free_ref(vlan);
|
||||
batadv_softif_vlan_free_ref(vlan);
|
||||
|
||||
@@ -1166,8 +1181,10 @@ static void batadv_tt_local_table_free(struct batadv_priv *bat_priv)
|
||||
/* decrease the reference held for this vlan */
|
||||
vlan = batadv_softif_vlan_get(bat_priv,
|
||||
tt_common_entry->vid);
|
||||
batadv_softif_vlan_free_ref(vlan);
|
||||
batadv_softif_vlan_free_ref(vlan);
|
||||
if (vlan) {
|
||||
batadv_softif_vlan_free_ref(vlan);
|
||||
batadv_softif_vlan_free_ref(vlan);
|
||||
}
|
||||
|
||||
batadv_tt_local_entry_free_ref(tt_local);
|
||||
}
|
||||
@@ -3207,8 +3224,10 @@ static void batadv_tt_local_purge_pending_clients(struct batadv_priv *bat_priv)
|
||||
|
||||
/* decrease the reference held for this vlan */
|
||||
vlan = batadv_softif_vlan_get(bat_priv, tt_common->vid);
|
||||
batadv_softif_vlan_free_ref(vlan);
|
||||
batadv_softif_vlan_free_ref(vlan);
|
||||
if (vlan) {
|
||||
batadv_softif_vlan_free_ref(vlan);
|
||||
batadv_softif_vlan_free_ref(vlan);
|
||||
}
|
||||
|
||||
batadv_tt_local_entry_free_ref(tt_local);
|
||||
}
|
||||
|
||||
@@ -7843,7 +7843,7 @@ void mgmt_new_ltk(struct hci_dev *hdev, struct smp_ltk *key, bool persistent)
|
||||
/* Make sure we copy only the significant bytes based on the
|
||||
* encryption key size, and set the rest of the value to zeroes.
|
||||
*/
|
||||
memcpy(ev.key.val, key->val, sizeof(key->enc_size));
|
||||
memcpy(ev.key.val, key->val, key->enc_size);
|
||||
memset(ev.key.val + key->enc_size, 0,
|
||||
sizeof(ev.key.val) - key->enc_size);
|
||||
|
||||
|
||||
@@ -112,6 +112,8 @@ static inline size_t br_port_info_size(void)
|
||||
+ nla_total_size(1) /* IFLA_BRPORT_FAST_LEAVE */
|
||||
+ nla_total_size(1) /* IFLA_BRPORT_LEARNING */
|
||||
+ nla_total_size(1) /* IFLA_BRPORT_UNICAST_FLOOD */
|
||||
+ nla_total_size(1) /* IFLA_BRPORT_PROXYARP */
|
||||
+ nla_total_size(1) /* IFLA_BRPORT_PROXYARP_WIFI */
|
||||
+ 0;
|
||||
}
|
||||
|
||||
@@ -504,6 +506,8 @@ static const struct nla_policy br_port_policy[IFLA_BRPORT_MAX + 1] = {
|
||||
[IFLA_BRPORT_FAST_LEAVE]= { .type = NLA_U8 },
|
||||
[IFLA_BRPORT_LEARNING] = { .type = NLA_U8 },
|
||||
[IFLA_BRPORT_UNICAST_FLOOD] = { .type = NLA_U8 },
|
||||
[IFLA_BRPORT_PROXYARP] = { .type = NLA_U8 },
|
||||
[IFLA_BRPORT_PROXYARP_WIFI] = { .type = NLA_U8 },
|
||||
};
|
||||
|
||||
/* Change the state of the port and notify spanning tree */
|
||||
|
||||
+7
-6
@@ -131,12 +131,12 @@ out_noerr:
|
||||
goto out;
|
||||
}
|
||||
|
||||
static int skb_set_peeked(struct sk_buff *skb)
|
||||
static struct sk_buff *skb_set_peeked(struct sk_buff *skb)
|
||||
{
|
||||
struct sk_buff *nskb;
|
||||
|
||||
if (skb->peeked)
|
||||
return 0;
|
||||
return skb;
|
||||
|
||||
/* We have to unshare an skb before modifying it. */
|
||||
if (!skb_shared(skb))
|
||||
@@ -144,7 +144,7 @@ static int skb_set_peeked(struct sk_buff *skb)
|
||||
|
||||
nskb = skb_clone(skb, GFP_ATOMIC);
|
||||
if (!nskb)
|
||||
return -ENOMEM;
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
skb->prev->next = nskb;
|
||||
skb->next->prev = nskb;
|
||||
@@ -157,7 +157,7 @@ static int skb_set_peeked(struct sk_buff *skb)
|
||||
done:
|
||||
skb->peeked = 1;
|
||||
|
||||
return 0;
|
||||
return skb;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -229,8 +229,9 @@ struct sk_buff *__skb_recv_datagram(struct sock *sk, unsigned int flags,
|
||||
continue;
|
||||
}
|
||||
|
||||
error = skb_set_peeked(skb);
|
||||
if (error)
|
||||
skb = skb_set_peeked(skb);
|
||||
error = PTR_ERR(skb);
|
||||
if (IS_ERR(skb))
|
||||
goto unlock_err;
|
||||
|
||||
atomic_inc(&skb->users);
|
||||
|
||||
@@ -3513,8 +3513,6 @@ static int pktgen_thread_worker(void *arg)
|
||||
|
||||
set_freezable();
|
||||
|
||||
__set_current_state(TASK_RUNNING);
|
||||
|
||||
while (!kthread_should_stop()) {
|
||||
pkt_dev = next_to_run(t);
|
||||
|
||||
@@ -3559,7 +3557,6 @@ static int pktgen_thread_worker(void *arg)
|
||||
|
||||
try_to_freeze();
|
||||
}
|
||||
set_current_state(TASK_INTERRUPTIBLE);
|
||||
|
||||
pr_debug("%s stopping all device\n", t->tsk->comm);
|
||||
pktgen_stop(t);
|
||||
|
||||
@@ -103,10 +103,16 @@ void reqsk_queue_destroy(struct request_sock_queue *queue)
|
||||
spin_lock_bh(&queue->syn_wait_lock);
|
||||
while ((req = lopt->syn_table[i]) != NULL) {
|
||||
lopt->syn_table[i] = req->dl_next;
|
||||
/* Because of following del_timer_sync(),
|
||||
* we must release the spinlock here
|
||||
* or risk a dead lock.
|
||||
*/
|
||||
spin_unlock_bh(&queue->syn_wait_lock);
|
||||
atomic_inc(&lopt->qlen_dec);
|
||||
if (del_timer(&req->rsk_timer))
|
||||
if (del_timer_sync(&req->rsk_timer))
|
||||
reqsk_put(req);
|
||||
reqsk_put(req);
|
||||
spin_lock_bh(&queue->syn_wait_lock);
|
||||
}
|
||||
spin_unlock_bh(&queue->syn_wait_lock);
|
||||
}
|
||||
|
||||
+2
-1
@@ -856,7 +856,8 @@ static int dsa_slave_phy_connect(struct dsa_slave_priv *p,
|
||||
return -ENODEV;
|
||||
|
||||
/* Use already configured phy mode */
|
||||
p->phy_interface = p->phy->interface;
|
||||
if (p->phy_interface == PHY_INTERFACE_MODE_NA)
|
||||
p->phy_interface = p->phy->interface;
|
||||
phy_connect_direct(slave_dev, p->phy, dsa_slave_adjust_link,
|
||||
p->phy_interface);
|
||||
|
||||
|
||||
@@ -593,7 +593,7 @@ static bool reqsk_queue_unlink(struct request_sock_queue *queue,
|
||||
}
|
||||
|
||||
spin_unlock(&queue->syn_wait_lock);
|
||||
if (del_timer(&req->rsk_timer))
|
||||
if (del_timer_sync(&req->rsk_timer))
|
||||
reqsk_put(req);
|
||||
return found;
|
||||
}
|
||||
|
||||
@@ -226,7 +226,8 @@ synproxy_send_client_ack(const struct synproxy_net *snet,
|
||||
|
||||
synproxy_build_options(nth, opts);
|
||||
|
||||
synproxy_send_tcp(skb, nskb, NULL, 0, niph, nth, tcp_hdr_size);
|
||||
synproxy_send_tcp(skb, nskb, skb->nfct, IP_CT_ESTABLISHED_REPLY,
|
||||
niph, nth, tcp_hdr_size);
|
||||
}
|
||||
|
||||
static bool
|
||||
|
||||
+1
-1
@@ -1348,7 +1348,7 @@ static struct sock *tcp_v4_hnd_req(struct sock *sk, struct sk_buff *skb)
|
||||
req = inet_csk_search_req(sk, th->source, iph->saddr, iph->daddr);
|
||||
if (req) {
|
||||
nsk = tcp_check_req(sk, skb, req, false);
|
||||
if (!nsk)
|
||||
if (!nsk || nsk == sk)
|
||||
reqsk_put(req);
|
||||
return nsk;
|
||||
}
|
||||
|
||||
+10
-3
@@ -1995,12 +1995,19 @@ void udp_v4_early_demux(struct sk_buff *skb)
|
||||
|
||||
skb->sk = sk;
|
||||
skb->destructor = sock_efree;
|
||||
dst = sk->sk_rx_dst;
|
||||
dst = READ_ONCE(sk->sk_rx_dst);
|
||||
|
||||
if (dst)
|
||||
dst = dst_check(dst, 0);
|
||||
if (dst)
|
||||
skb_dst_set_noref(skb, dst);
|
||||
if (dst) {
|
||||
/* DST_NOCACHE can not be used without taking a reference */
|
||||
if (dst->flags & DST_NOCACHE) {
|
||||
if (likely(atomic_inc_not_zero(&dst->__refcnt)))
|
||||
skb_dst_set(skb, dst);
|
||||
} else {
|
||||
skb_dst_set_noref(skb, dst);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int udp_rcv(struct sk_buff *skb)
|
||||
|
||||
@@ -37,12 +37,13 @@ synproxy_build_ip(struct sk_buff *skb, const struct in6_addr *saddr,
|
||||
}
|
||||
|
||||
static void
|
||||
synproxy_send_tcp(const struct sk_buff *skb, struct sk_buff *nskb,
|
||||
synproxy_send_tcp(const struct synproxy_net *snet,
|
||||
const struct sk_buff *skb, struct sk_buff *nskb,
|
||||
struct nf_conntrack *nfct, enum ip_conntrack_info ctinfo,
|
||||
struct ipv6hdr *niph, struct tcphdr *nth,
|
||||
unsigned int tcp_hdr_size)
|
||||
{
|
||||
struct net *net = nf_ct_net((struct nf_conn *)nfct);
|
||||
struct net *net = nf_ct_net(snet->tmpl);
|
||||
struct dst_entry *dst;
|
||||
struct flowi6 fl6;
|
||||
|
||||
@@ -83,7 +84,8 @@ free_nskb:
|
||||
}
|
||||
|
||||
static void
|
||||
synproxy_send_client_synack(const struct sk_buff *skb, const struct tcphdr *th,
|
||||
synproxy_send_client_synack(const struct synproxy_net *snet,
|
||||
const struct sk_buff *skb, const struct tcphdr *th,
|
||||
const struct synproxy_options *opts)
|
||||
{
|
||||
struct sk_buff *nskb;
|
||||
@@ -119,7 +121,7 @@ synproxy_send_client_synack(const struct sk_buff *skb, const struct tcphdr *th,
|
||||
|
||||
synproxy_build_options(nth, opts);
|
||||
|
||||
synproxy_send_tcp(skb, nskb, skb->nfct, IP_CT_ESTABLISHED_REPLY,
|
||||
synproxy_send_tcp(snet, skb, nskb, skb->nfct, IP_CT_ESTABLISHED_REPLY,
|
||||
niph, nth, tcp_hdr_size);
|
||||
}
|
||||
|
||||
@@ -163,7 +165,7 @@ synproxy_send_server_syn(const struct synproxy_net *snet,
|
||||
|
||||
synproxy_build_options(nth, opts);
|
||||
|
||||
synproxy_send_tcp(skb, nskb, &snet->tmpl->ct_general, IP_CT_NEW,
|
||||
synproxy_send_tcp(snet, skb, nskb, &snet->tmpl->ct_general, IP_CT_NEW,
|
||||
niph, nth, tcp_hdr_size);
|
||||
}
|
||||
|
||||
@@ -203,7 +205,7 @@ synproxy_send_server_ack(const struct synproxy_net *snet,
|
||||
|
||||
synproxy_build_options(nth, opts);
|
||||
|
||||
synproxy_send_tcp(skb, nskb, NULL, 0, niph, nth, tcp_hdr_size);
|
||||
synproxy_send_tcp(snet, skb, nskb, NULL, 0, niph, nth, tcp_hdr_size);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -241,7 +243,8 @@ synproxy_send_client_ack(const struct synproxy_net *snet,
|
||||
|
||||
synproxy_build_options(nth, opts);
|
||||
|
||||
synproxy_send_tcp(skb, nskb, NULL, 0, niph, nth, tcp_hdr_size);
|
||||
synproxy_send_tcp(snet, skb, nskb, skb->nfct, IP_CT_ESTABLISHED_REPLY,
|
||||
niph, nth, tcp_hdr_size);
|
||||
}
|
||||
|
||||
static bool
|
||||
@@ -301,7 +304,7 @@ synproxy_tg6(struct sk_buff *skb, const struct xt_action_param *par)
|
||||
XT_SYNPROXY_OPT_SACK_PERM |
|
||||
XT_SYNPROXY_OPT_ECN);
|
||||
|
||||
synproxy_send_client_synack(skb, th, &opts);
|
||||
synproxy_send_client_synack(snet, skb, th, &opts);
|
||||
return NF_DROP;
|
||||
|
||||
} else if (th->ack && !(th->fin || th->rst || th->syn)) {
|
||||
|
||||
+4
-2
@@ -1844,6 +1844,7 @@ int ip6_route_add(struct fib6_config *cfg)
|
||||
int gwa_type;
|
||||
|
||||
gw_addr = &cfg->fc_gateway;
|
||||
gwa_type = ipv6_addr_type(gw_addr);
|
||||
|
||||
/* if gw_addr is local we will fail to detect this in case
|
||||
* address is still TENTATIVE (DAD in progress). rt6_lookup()
|
||||
@@ -1851,11 +1852,12 @@ int ip6_route_add(struct fib6_config *cfg)
|
||||
* prefix route was assigned to, which might be non-loopback.
|
||||
*/
|
||||
err = -EINVAL;
|
||||
if (ipv6_chk_addr_and_flags(net, gw_addr, NULL, 0, 0))
|
||||
if (ipv6_chk_addr_and_flags(net, gw_addr,
|
||||
gwa_type & IPV6_ADDR_LINKLOCAL ?
|
||||
dev : NULL, 0, 0))
|
||||
goto out;
|
||||
|
||||
rt->rt6i_gateway = *gw_addr;
|
||||
gwa_type = ipv6_addr_type(gw_addr);
|
||||
|
||||
if (gwa_type != (IPV6_ADDR_LINKLOCAL|IPV6_ADDR_UNICAST)) {
|
||||
struct rt6_info *grt;
|
||||
|
||||
+1
-1
@@ -943,7 +943,7 @@ static struct sock *tcp_v6_hnd_req(struct sock *sk, struct sk_buff *skb)
|
||||
&ipv6_hdr(skb)->daddr, tcp_v6_iif(skb));
|
||||
if (req) {
|
||||
nsk = tcp_check_req(sk, skb, req, false);
|
||||
if (!nsk)
|
||||
if (!nsk || nsk == sk)
|
||||
reqsk_put(req);
|
||||
return nsk;
|
||||
}
|
||||
|
||||
@@ -292,7 +292,7 @@ struct nf_conn *nf_ct_tmpl_alloc(struct net *net, u16 zone, gfp_t flags)
|
||||
{
|
||||
struct nf_conn *tmpl;
|
||||
|
||||
tmpl = kzalloc(sizeof(struct nf_conn), GFP_KERNEL);
|
||||
tmpl = kzalloc(sizeof(*tmpl), flags);
|
||||
if (tmpl == NULL)
|
||||
return NULL;
|
||||
|
||||
@@ -303,7 +303,7 @@ struct nf_conn *nf_ct_tmpl_alloc(struct net *net, u16 zone, gfp_t flags)
|
||||
if (zone) {
|
||||
struct nf_conntrack_zone *nf_ct_zone;
|
||||
|
||||
nf_ct_zone = nf_ct_ext_add(tmpl, NF_CT_EXT_ZONE, GFP_ATOMIC);
|
||||
nf_ct_zone = nf_ct_ext_add(tmpl, NF_CT_EXT_ZONE, flags);
|
||||
if (!nf_ct_zone)
|
||||
goto out_free;
|
||||
nf_ct_zone->id = zone;
|
||||
@@ -1544,10 +1544,8 @@ void *nf_ct_alloc_hashtable(unsigned int *sizep, int nulls)
|
||||
sz = nr_slots * sizeof(struct hlist_nulls_head);
|
||||
hash = (void *)__get_free_pages(GFP_KERNEL | __GFP_NOWARN | __GFP_ZERO,
|
||||
get_order(sz));
|
||||
if (!hash) {
|
||||
printk(KERN_WARNING "nf_conntrack: falling back to vmalloc.\n");
|
||||
if (!hash)
|
||||
hash = vzalloc(sz);
|
||||
}
|
||||
|
||||
if (hash && nulls)
|
||||
for (i = 0; i < nr_slots; i++)
|
||||
|
||||
@@ -353,10 +353,8 @@ static int __net_init synproxy_net_init(struct net *net)
|
||||
int err = -ENOMEM;
|
||||
|
||||
ct = nf_ct_tmpl_alloc(net, 0, GFP_KERNEL);
|
||||
if (IS_ERR(ct)) {
|
||||
err = PTR_ERR(ct);
|
||||
if (!ct)
|
||||
goto err1;
|
||||
}
|
||||
|
||||
if (!nfct_seqadj_ext_add(ct))
|
||||
goto err2;
|
||||
|
||||
@@ -202,9 +202,10 @@ static int xt_ct_tg_check(const struct xt_tgchk_param *par,
|
||||
goto err1;
|
||||
|
||||
ct = nf_ct_tmpl_alloc(par->net, info->zone, GFP_KERNEL);
|
||||
ret = PTR_ERR(ct);
|
||||
if (IS_ERR(ct))
|
||||
if (!ct) {
|
||||
ret = -ENOMEM;
|
||||
goto err2;
|
||||
}
|
||||
|
||||
ret = 0;
|
||||
if ((info->ct_events || info->exp_events) &&
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user