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-next
Pull networking updates from David Miller:
"Here is my initial pull request for the networking subsystem during
this merge window:
1) Support for ESN in AH (RFC 4302) from Fan Du.
2) Add full kernel doc for ethtool command structures, from Ben
Hutchings.
3) Add BCM7xxx PHY driver, from Florian Fainelli.
4) Export computed TCP rate information in netlink socket dumps, from
Eric Dumazet.
5) Allow IPSEC SA to be dumped partially using a filter, from Nicolas
Dichtel.
6) Convert many drivers to pci_enable_msix_range(), from Alexander
Gordeev.
7) Record SKB timestamps more efficiently, from Eric Dumazet.
8) Switch to microsecond resolution for TCP round trip times, also
from Eric Dumazet.
9) Clean up and fix 6lowpan fragmentation handling by making use of
the existing inet_frag api for it's implementation.
10) Add TX grant mapping to xen-netback driver, from Zoltan Kiss.
11) Auto size SKB lengths when composing netlink messages based upon
past message sizes used, from Eric Dumazet.
12) qdisc dumps can take a long time, add a cond_resched(), From Eric
Dumazet.
13) Sanitize netpoll core and drivers wrt. SKB handling semantics.
Get rid of never-used-in-tree netpoll RX handling. From Eric W
Biederman.
14) Support inter-address-family and namespace changing in VTI tunnel
driver(s). From Steffen Klassert.
15) Add Altera TSE driver, from Vince Bridgers.
16) Optimizing csum_replace2() so that it doesn't adjust the checksum
by checksumming the entire header, from Eric Dumazet.
17) Expand BPF internal implementation for faster interpreting, more
direct translations into JIT'd code, and much cleaner uses of BPF
filtering in non-socket ocntexts. From Daniel Borkmann and Alexei
Starovoitov"
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1976 commits)
netpoll: Use skb_irq_freeable to make zap_completion_queue safe.
net: Add a test to see if a skb is freeable in irq context
qlcnic: Fix build failure due to undefined reference to `vxlan_get_rx_port'
net: ptp: move PTP classifier in its own file
net: sxgbe: make "core_ops" static
net: sxgbe: fix logical vs bitwise operation
net: sxgbe: sxgbe_mdio_register() frees the bus
Call efx_set_channels() before efx->type->dimension_resources()
xen-netback: disable rogue vif in kthread context
net/mlx4: Set proper build dependancy with vxlan
be2net: fix build dependency on VxLAN
mac802154: make csma/cca parameters per-wpan
mac802154: allow only one WPAN to be up at any given time
net: filter: minor: fix kdoc in __sk_run_filter
netlink: don't compare the nul-termination in nla_strcmp
can: c_can: Avoid led toggling for every packet.
can: c_can: Simplify TX interrupt cleanup
can: c_can: Store dlc private
can: c_can: Reduce register access
can: c_can: Make the code readable
...
This commit is contained in:
+2
-2
@@ -38,9 +38,9 @@ struct vlan_info {
|
||||
static inline unsigned int vlan_proto_idx(__be16 proto)
|
||||
{
|
||||
switch (proto) {
|
||||
case __constant_htons(ETH_P_8021Q):
|
||||
case htons(ETH_P_8021Q):
|
||||
return VLAN_PROTO_8021Q;
|
||||
case __constant_htons(ETH_P_8021AD):
|
||||
case htons(ETH_P_8021AD):
|
||||
return VLAN_PROTO_8021AD;
|
||||
default:
|
||||
BUG();
|
||||
|
||||
@@ -22,11 +22,11 @@ bool vlan_do_receive(struct sk_buff **skbp)
|
||||
return false;
|
||||
|
||||
skb->dev = vlan_dev;
|
||||
if (skb->pkt_type == PACKET_OTHERHOST) {
|
||||
if (unlikely(skb->pkt_type == PACKET_OTHERHOST)) {
|
||||
/* Our lower layer thinks this is not local, let's make sure.
|
||||
* This allows the VLAN to have a different MAC than the
|
||||
* underlying device, and still route correctly. */
|
||||
if (ether_addr_equal(eth_hdr(skb)->h_dest, vlan_dev->dev_addr))
|
||||
if (ether_addr_equal_64bits(eth_hdr(skb)->h_dest, vlan_dev->dev_addr))
|
||||
skb->pkt_type = PACKET_HOST;
|
||||
}
|
||||
|
||||
@@ -106,6 +106,12 @@ u16 vlan_dev_vlan_id(const struct net_device *dev)
|
||||
}
|
||||
EXPORT_SYMBOL(vlan_dev_vlan_id);
|
||||
|
||||
__be16 vlan_dev_vlan_proto(const struct net_device *dev)
|
||||
{
|
||||
return vlan_dev_priv(dev)->vlan_proto;
|
||||
}
|
||||
EXPORT_SYMBOL(vlan_dev_vlan_proto);
|
||||
|
||||
static struct sk_buff *vlan_reorder_header(struct sk_buff *skb)
|
||||
{
|
||||
if (skb_cow(skb, skb_headroom(skb)) < 0)
|
||||
|
||||
+7
-15
@@ -559,7 +559,7 @@ static const struct net_device_ops vlan_netdev_ops;
|
||||
static int vlan_dev_init(struct net_device *dev)
|
||||
{
|
||||
struct net_device *real_dev = vlan_dev_priv(dev)->real_dev;
|
||||
int subclass = 0, i;
|
||||
int subclass = 0;
|
||||
|
||||
netif_carrier_off(dev);
|
||||
|
||||
@@ -613,17 +613,10 @@ static int vlan_dev_init(struct net_device *dev)
|
||||
|
||||
vlan_dev_set_lockdep_class(dev, subclass);
|
||||
|
||||
vlan_dev_priv(dev)->vlan_pcpu_stats = alloc_percpu(struct vlan_pcpu_stats);
|
||||
vlan_dev_priv(dev)->vlan_pcpu_stats = netdev_alloc_pcpu_stats(struct vlan_pcpu_stats);
|
||||
if (!vlan_dev_priv(dev)->vlan_pcpu_stats)
|
||||
return -ENOMEM;
|
||||
|
||||
for_each_possible_cpu(i) {
|
||||
struct vlan_pcpu_stats *vlan_stat;
|
||||
vlan_stat = per_cpu_ptr(vlan_dev_priv(dev)->vlan_pcpu_stats, i);
|
||||
u64_stats_init(&vlan_stat->syncp);
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -689,13 +682,13 @@ static struct rtnl_link_stats64 *vlan_dev_get_stats64(struct net_device *dev, st
|
||||
|
||||
p = per_cpu_ptr(vlan_dev_priv(dev)->vlan_pcpu_stats, i);
|
||||
do {
|
||||
start = u64_stats_fetch_begin_bh(&p->syncp);
|
||||
start = u64_stats_fetch_begin_irq(&p->syncp);
|
||||
rxpackets = p->rx_packets;
|
||||
rxbytes = p->rx_bytes;
|
||||
rxmulticast = p->rx_multicast;
|
||||
txpackets = p->tx_packets;
|
||||
txbytes = p->tx_bytes;
|
||||
} while (u64_stats_fetch_retry_bh(&p->syncp, start));
|
||||
} while (u64_stats_fetch_retry_irq(&p->syncp, start));
|
||||
|
||||
stats->rx_packets += rxpackets;
|
||||
stats->rx_bytes += rxbytes;
|
||||
@@ -718,20 +711,19 @@ static void vlan_dev_poll_controller(struct net_device *dev)
|
||||
return;
|
||||
}
|
||||
|
||||
static int vlan_dev_netpoll_setup(struct net_device *dev, struct netpoll_info *npinfo,
|
||||
gfp_t gfp)
|
||||
static int vlan_dev_netpoll_setup(struct net_device *dev, struct netpoll_info *npinfo)
|
||||
{
|
||||
struct vlan_dev_priv *vlan = vlan_dev_priv(dev);
|
||||
struct net_device *real_dev = vlan->real_dev;
|
||||
struct netpoll *netpoll;
|
||||
int err = 0;
|
||||
|
||||
netpoll = kzalloc(sizeof(*netpoll), gfp);
|
||||
netpoll = kzalloc(sizeof(*netpoll), GFP_KERNEL);
|
||||
err = -ENOMEM;
|
||||
if (!netpoll)
|
||||
goto out;
|
||||
|
||||
err = __netpoll_setup(netpoll, real_dev, gfp);
|
||||
err = __netpoll_setup(netpoll, real_dev);
|
||||
if (err) {
|
||||
kfree(netpoll);
|
||||
goto out;
|
||||
|
||||
@@ -56,8 +56,8 @@ static int vlan_validate(struct nlattr *tb[], struct nlattr *data[])
|
||||
|
||||
if (data[IFLA_VLAN_PROTOCOL]) {
|
||||
switch (nla_get_be16(data[IFLA_VLAN_PROTOCOL])) {
|
||||
case __constant_htons(ETH_P_8021Q):
|
||||
case __constant_htons(ETH_P_8021AD):
|
||||
case htons(ETH_P_8021Q):
|
||||
case htons(ETH_P_8021AD):
|
||||
break;
|
||||
default:
|
||||
return -EPROTONOSUPPORT;
|
||||
|
||||
@@ -89,8 +89,12 @@ config NETWORK_SECMARK
|
||||
to nfmark, but designated for security purposes.
|
||||
If you are unsure how to answer this question, answer N.
|
||||
|
||||
config NET_PTP_CLASSIFY
|
||||
def_bool n
|
||||
|
||||
config NETWORK_PHY_TIMESTAMPING
|
||||
bool "Timestamping in PHY devices"
|
||||
select NET_PTP_CLASSIFY
|
||||
help
|
||||
This allows timestamping of network packets by PHYs with
|
||||
hardware timestamping capabilities. This option adds some
|
||||
|
||||
@@ -926,7 +926,7 @@ static struct aarp_entry *iter_next(struct aarp_iter_state *iter, loff_t *pos)
|
||||
struct aarp_entry *entry;
|
||||
|
||||
rescan:
|
||||
while(ct < AARP_HASH_SIZE) {
|
||||
while (ct < AARP_HASH_SIZE) {
|
||||
for (entry = table[ct]; entry; entry = entry->next) {
|
||||
if (!pos || ++off == *pos) {
|
||||
iter->table = table;
|
||||
@@ -995,7 +995,7 @@ static const char *dt2str(unsigned long ticks)
|
||||
{
|
||||
static char buf[32];
|
||||
|
||||
sprintf(buf, "%ld.%02ld", ticks / HZ, ((ticks % HZ) * 100 ) / HZ);
|
||||
sprintf(buf, "%ld.%02ld", ticks / HZ, ((ticks % HZ) * 100) / HZ);
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
+50
-50
@@ -293,7 +293,7 @@ static int atif_probe_device(struct atalk_iface *atif)
|
||||
|
||||
/* Perform AARP probing for a proxy address */
|
||||
static int atif_proxy_probe_device(struct atalk_iface *atif,
|
||||
struct atalk_addr* proxy_addr)
|
||||
struct atalk_addr *proxy_addr)
|
||||
{
|
||||
int netrange = ntohs(atif->nets.nr_lastnet) -
|
||||
ntohs(atif->nets.nr_firstnet) + 1;
|
||||
@@ -581,7 +581,7 @@ out:
|
||||
}
|
||||
|
||||
/* Delete a route. Find it and discard it */
|
||||
static int atrtr_delete(struct atalk_addr * addr)
|
||||
static int atrtr_delete(struct atalk_addr *addr)
|
||||
{
|
||||
struct atalk_route **r = &atalk_routes;
|
||||
int retval = 0;
|
||||
@@ -936,11 +936,11 @@ static unsigned long atalk_sum_skb(const struct sk_buff *skb, int offset,
|
||||
int i, copy;
|
||||
|
||||
/* checksum stuff in header space */
|
||||
if ( (copy = start - offset) > 0) {
|
||||
if ((copy = start - offset) > 0) {
|
||||
if (copy > len)
|
||||
copy = len;
|
||||
sum = atalk_sum_partial(skb->data + offset, copy, sum);
|
||||
if ( (len -= copy) == 0)
|
||||
if ((len -= copy) == 0)
|
||||
return sum;
|
||||
|
||||
offset += copy;
|
||||
@@ -1151,7 +1151,7 @@ static int atalk_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
|
||||
goto out;
|
||||
|
||||
at->src_net = addr->sat_addr.s_net = ap->s_net;
|
||||
at->src_node = addr->sat_addr.s_node= ap->s_node;
|
||||
at->src_node = addr->sat_addr.s_node = ap->s_node;
|
||||
} else {
|
||||
err = -EADDRNOTAVAIL;
|
||||
if (!atalk_find_interface(addr->sat_addr.s_net,
|
||||
@@ -1790,53 +1790,53 @@ static int atalk_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
|
||||
void __user *argp = (void __user *)arg;
|
||||
|
||||
switch (cmd) {
|
||||
/* Protocol layer */
|
||||
case TIOCOUTQ: {
|
||||
long amount = sk->sk_sndbuf - sk_wmem_alloc_get(sk);
|
||||
/* Protocol layer */
|
||||
case TIOCOUTQ: {
|
||||
long amount = sk->sk_sndbuf - sk_wmem_alloc_get(sk);
|
||||
|
||||
if (amount < 0)
|
||||
amount = 0;
|
||||
rc = put_user(amount, (int __user *)argp);
|
||||
break;
|
||||
}
|
||||
case TIOCINQ: {
|
||||
/*
|
||||
* These two are safe on a single CPU system as only
|
||||
* user tasks fiddle here
|
||||
*/
|
||||
struct sk_buff *skb = skb_peek(&sk->sk_receive_queue);
|
||||
long amount = 0;
|
||||
if (amount < 0)
|
||||
amount = 0;
|
||||
rc = put_user(amount, (int __user *)argp);
|
||||
break;
|
||||
}
|
||||
case TIOCINQ: {
|
||||
/*
|
||||
* These two are safe on a single CPU system as only
|
||||
* user tasks fiddle here
|
||||
*/
|
||||
struct sk_buff *skb = skb_peek(&sk->sk_receive_queue);
|
||||
long amount = 0;
|
||||
|
||||
if (skb)
|
||||
amount = skb->len - sizeof(struct ddpehdr);
|
||||
rc = put_user(amount, (int __user *)argp);
|
||||
break;
|
||||
}
|
||||
case SIOCGSTAMP:
|
||||
rc = sock_get_timestamp(sk, argp);
|
||||
break;
|
||||
case SIOCGSTAMPNS:
|
||||
rc = sock_get_timestampns(sk, argp);
|
||||
break;
|
||||
/* Routing */
|
||||
case SIOCADDRT:
|
||||
case SIOCDELRT:
|
||||
rc = -EPERM;
|
||||
if (capable(CAP_NET_ADMIN))
|
||||
rc = atrtr_ioctl(cmd, argp);
|
||||
break;
|
||||
/* Interface */
|
||||
case SIOCGIFADDR:
|
||||
case SIOCSIFADDR:
|
||||
case SIOCGIFBRDADDR:
|
||||
case SIOCATALKDIFADDR:
|
||||
case SIOCDIFADDR:
|
||||
case SIOCSARP: /* proxy AARP */
|
||||
case SIOCDARP: /* proxy AARP */
|
||||
rtnl_lock();
|
||||
rc = atif_ioctl(cmd, argp);
|
||||
rtnl_unlock();
|
||||
break;
|
||||
if (skb)
|
||||
amount = skb->len - sizeof(struct ddpehdr);
|
||||
rc = put_user(amount, (int __user *)argp);
|
||||
break;
|
||||
}
|
||||
case SIOCGSTAMP:
|
||||
rc = sock_get_timestamp(sk, argp);
|
||||
break;
|
||||
case SIOCGSTAMPNS:
|
||||
rc = sock_get_timestampns(sk, argp);
|
||||
break;
|
||||
/* Routing */
|
||||
case SIOCADDRT:
|
||||
case SIOCDELRT:
|
||||
rc = -EPERM;
|
||||
if (capable(CAP_NET_ADMIN))
|
||||
rc = atrtr_ioctl(cmd, argp);
|
||||
break;
|
||||
/* Interface */
|
||||
case SIOCGIFADDR:
|
||||
case SIOCSIFADDR:
|
||||
case SIOCGIFBRDADDR:
|
||||
case SIOCATALKDIFADDR:
|
||||
case SIOCDIFADDR:
|
||||
case SIOCSARP: /* proxy AARP */
|
||||
case SIOCDARP: /* proxy AARP */
|
||||
rtnl_lock();
|
||||
rc = atif_ioctl(cmd, argp);
|
||||
rtnl_unlock();
|
||||
break;
|
||||
}
|
||||
|
||||
return rc;
|
||||
|
||||
+1
-1
@@ -1492,7 +1492,7 @@ static void __exit atm_mpoa_cleanup(void)
|
||||
|
||||
mpc_proc_clean();
|
||||
|
||||
del_timer(&mpc_timer);
|
||||
del_timer_sync(&mpc_timer);
|
||||
unregister_netdevice_notifier(&mpoa_notifier);
|
||||
deregister_atm_ioctl(&atm_ioctl_ops);
|
||||
|
||||
|
||||
@@ -50,6 +50,15 @@ config BATMAN_ADV_NC
|
||||
If you think that your network does not need this feature you
|
||||
can safely disable it and save some space.
|
||||
|
||||
config BATMAN_ADV_MCAST
|
||||
bool "Multicast optimisation"
|
||||
depends on BATMAN_ADV
|
||||
default n
|
||||
help
|
||||
This option enables the multicast optimisation which aims to
|
||||
reduce the air overhead while improving the reliability of
|
||||
multicast messages.
|
||||
|
||||
config BATMAN_ADV_DEBUG
|
||||
bool "B.A.T.M.A.N. debugging"
|
||||
depends on BATMAN_ADV
|
||||
|
||||
@@ -36,3 +36,4 @@ batman-adv-y += send.o
|
||||
batman-adv-y += soft-interface.o
|
||||
batman-adv-y += sysfs.o
|
||||
batman-adv-y += translation-table.o
|
||||
batman-adv-$(CONFIG_BATMAN_ADV_MCAST) += multicast.o
|
||||
|
||||
@@ -347,10 +347,10 @@ static void batadv_iv_ogm_iface_update_mac(struct batadv_hard_iface *hard_iface)
|
||||
unsigned char *ogm_buff = hard_iface->bat_iv.ogm_buff;
|
||||
|
||||
batadv_ogm_packet = (struct batadv_ogm_packet *)ogm_buff;
|
||||
memcpy(batadv_ogm_packet->orig,
|
||||
hard_iface->net_dev->dev_addr, ETH_ALEN);
|
||||
memcpy(batadv_ogm_packet->prev_sender,
|
||||
hard_iface->net_dev->dev_addr, ETH_ALEN);
|
||||
ether_addr_copy(batadv_ogm_packet->orig,
|
||||
hard_iface->net_dev->dev_addr);
|
||||
ether_addr_copy(batadv_ogm_packet->prev_sender,
|
||||
hard_iface->net_dev->dev_addr);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -830,7 +830,7 @@ static void batadv_iv_ogm_forward(struct batadv_orig_node *orig_node,
|
||||
tvlv_len = ntohs(batadv_ogm_packet->tvlv_len);
|
||||
|
||||
batadv_ogm_packet->ttl--;
|
||||
memcpy(batadv_ogm_packet->prev_sender, ethhdr->h_source, ETH_ALEN);
|
||||
ether_addr_copy(batadv_ogm_packet->prev_sender, ethhdr->h_source);
|
||||
|
||||
/* apply hop penalty */
|
||||
batadv_ogm_packet->tq = batadv_hop_penalty(batadv_ogm_packet->tq,
|
||||
|
||||
@@ -191,7 +191,7 @@ batadv_backbone_hash_find(struct batadv_priv *bat_priv,
|
||||
if (!hash)
|
||||
return NULL;
|
||||
|
||||
memcpy(search_entry.orig, addr, ETH_ALEN);
|
||||
ether_addr_copy(search_entry.orig, addr);
|
||||
search_entry.vid = vid;
|
||||
|
||||
index = batadv_choose_backbone_gw(&search_entry, hash->size);
|
||||
@@ -305,7 +305,7 @@ static void batadv_bla_send_claim(struct batadv_priv *bat_priv, uint8_t *mac,
|
||||
/* normal claim frame
|
||||
* set Ethernet SRC to the clients mac
|
||||
*/
|
||||
memcpy(ethhdr->h_source, mac, ETH_ALEN);
|
||||
ether_addr_copy(ethhdr->h_source, mac);
|
||||
batadv_dbg(BATADV_DBG_BLA, bat_priv,
|
||||
"bla_send_claim(): CLAIM %pM on vid %d\n", mac,
|
||||
BATADV_PRINT_VID(vid));
|
||||
@@ -314,7 +314,7 @@ static void batadv_bla_send_claim(struct batadv_priv *bat_priv, uint8_t *mac,
|
||||
/* unclaim frame
|
||||
* set HW SRC to the clients mac
|
||||
*/
|
||||
memcpy(hw_src, mac, ETH_ALEN);
|
||||
ether_addr_copy(hw_src, mac);
|
||||
batadv_dbg(BATADV_DBG_BLA, bat_priv,
|
||||
"bla_send_claim(): UNCLAIM %pM on vid %d\n", mac,
|
||||
BATADV_PRINT_VID(vid));
|
||||
@@ -323,7 +323,7 @@ static void batadv_bla_send_claim(struct batadv_priv *bat_priv, uint8_t *mac,
|
||||
/* announcement frame
|
||||
* set HW SRC to the special mac containg the crc
|
||||
*/
|
||||
memcpy(hw_src, mac, ETH_ALEN);
|
||||
ether_addr_copy(hw_src, mac);
|
||||
batadv_dbg(BATADV_DBG_BLA, bat_priv,
|
||||
"bla_send_claim(): ANNOUNCE of %pM on vid %d\n",
|
||||
ethhdr->h_source, BATADV_PRINT_VID(vid));
|
||||
@@ -333,8 +333,8 @@ static void batadv_bla_send_claim(struct batadv_priv *bat_priv, uint8_t *mac,
|
||||
* set HW SRC and header destination to the receiving backbone
|
||||
* gws mac
|
||||
*/
|
||||
memcpy(hw_src, mac, ETH_ALEN);
|
||||
memcpy(ethhdr->h_dest, mac, ETH_ALEN);
|
||||
ether_addr_copy(hw_src, mac);
|
||||
ether_addr_copy(ethhdr->h_dest, mac);
|
||||
batadv_dbg(BATADV_DBG_BLA, bat_priv,
|
||||
"bla_send_claim(): REQUEST of %pM to %pM on vid %d\n",
|
||||
ethhdr->h_source, ethhdr->h_dest,
|
||||
@@ -395,7 +395,7 @@ batadv_bla_get_backbone_gw(struct batadv_priv *bat_priv, uint8_t *orig,
|
||||
entry->bat_priv = bat_priv;
|
||||
atomic_set(&entry->request_sent, 0);
|
||||
atomic_set(&entry->wait_periods, 0);
|
||||
memcpy(entry->orig, orig, ETH_ALEN);
|
||||
ether_addr_copy(entry->orig, orig);
|
||||
|
||||
/* one for the hash, one for returning */
|
||||
atomic_set(&entry->refcount, 2);
|
||||
@@ -563,7 +563,7 @@ static void batadv_bla_add_claim(struct batadv_priv *bat_priv,
|
||||
struct batadv_bla_claim search_claim;
|
||||
int hash_added;
|
||||
|
||||
memcpy(search_claim.addr, mac, ETH_ALEN);
|
||||
ether_addr_copy(search_claim.addr, mac);
|
||||
search_claim.vid = vid;
|
||||
claim = batadv_claim_hash_find(bat_priv, &search_claim);
|
||||
|
||||
@@ -573,7 +573,7 @@ static void batadv_bla_add_claim(struct batadv_priv *bat_priv,
|
||||
if (!claim)
|
||||
return;
|
||||
|
||||
memcpy(claim->addr, mac, ETH_ALEN);
|
||||
ether_addr_copy(claim->addr, mac);
|
||||
claim->vid = vid;
|
||||
claim->lasttime = jiffies;
|
||||
claim->backbone_gw = backbone_gw;
|
||||
@@ -624,7 +624,7 @@ static void batadv_bla_del_claim(struct batadv_priv *bat_priv,
|
||||
{
|
||||
struct batadv_bla_claim search_claim, *claim;
|
||||
|
||||
memcpy(search_claim.addr, mac, ETH_ALEN);
|
||||
ether_addr_copy(search_claim.addr, mac);
|
||||
search_claim.vid = vid;
|
||||
claim = batadv_claim_hash_find(bat_priv, &search_claim);
|
||||
if (!claim)
|
||||
@@ -882,7 +882,7 @@ static int batadv_bla_process_claim(struct batadv_priv *bat_priv,
|
||||
proto = ethhdr->h_proto;
|
||||
headlen = ETH_HLEN;
|
||||
if (vid & BATADV_VLAN_HAS_TAG) {
|
||||
vhdr = (struct vlan_ethhdr *)ethhdr;
|
||||
vhdr = vlan_eth_hdr(skb);
|
||||
proto = vhdr->h_vlan_encapsulated_proto;
|
||||
headlen += VLAN_HLEN;
|
||||
}
|
||||
@@ -1103,8 +1103,8 @@ void batadv_bla_update_orig_address(struct batadv_priv *bat_priv,
|
||||
oldif->net_dev->dev_addr))
|
||||
continue;
|
||||
|
||||
memcpy(backbone_gw->orig,
|
||||
primary_if->net_dev->dev_addr, ETH_ALEN);
|
||||
ether_addr_copy(backbone_gw->orig,
|
||||
primary_if->net_dev->dev_addr);
|
||||
/* send an announce frame so others will ask for our
|
||||
* claims and update their tables.
|
||||
*/
|
||||
@@ -1310,7 +1310,7 @@ int batadv_bla_check_bcast_duplist(struct batadv_priv *bat_priv,
|
||||
entry = &bat_priv->bla.bcast_duplist[curr];
|
||||
entry->crc = crc;
|
||||
entry->entrytime = jiffies;
|
||||
memcpy(entry->orig, bcast_packet->orig, ETH_ALEN);
|
||||
ether_addr_copy(entry->orig, bcast_packet->orig);
|
||||
bat_priv->bla.bcast_duplist_curr = curr;
|
||||
|
||||
out:
|
||||
@@ -1458,7 +1458,7 @@ int batadv_bla_rx(struct batadv_priv *bat_priv, struct sk_buff *skb,
|
||||
if (is_multicast_ether_addr(ethhdr->h_dest) && is_bcast)
|
||||
goto handled;
|
||||
|
||||
memcpy(search_claim.addr, ethhdr->h_source, ETH_ALEN);
|
||||
ether_addr_copy(search_claim.addr, ethhdr->h_source);
|
||||
search_claim.vid = vid;
|
||||
claim = batadv_claim_hash_find(bat_priv, &search_claim);
|
||||
|
||||
@@ -1547,9 +1547,6 @@ int batadv_bla_tx(struct batadv_priv *bat_priv, struct sk_buff *skb,
|
||||
if (!atomic_read(&bat_priv->bridge_loop_avoidance))
|
||||
goto allow;
|
||||
|
||||
/* in VLAN case, the mac header might not be set. */
|
||||
skb_reset_mac_header(skb);
|
||||
|
||||
if (batadv_bla_process_claim(bat_priv, primary_if, skb))
|
||||
goto handled;
|
||||
|
||||
@@ -1560,7 +1557,7 @@ int batadv_bla_tx(struct batadv_priv *bat_priv, struct sk_buff *skb,
|
||||
if (is_multicast_ether_addr(ethhdr->h_dest))
|
||||
goto handled;
|
||||
|
||||
memcpy(search_claim.addr, ethhdr->h_source, ETH_ALEN);
|
||||
ether_addr_copy(search_claim.addr, ethhdr->h_source);
|
||||
search_claim.vid = vid;
|
||||
|
||||
claim = batadv_claim_hash_find(bat_priv, &search_claim);
|
||||
|
||||
@@ -277,7 +277,7 @@ static void batadv_dat_entry_add(struct batadv_priv *bat_priv, __be32 ip,
|
||||
/* if this entry is already known, just update it */
|
||||
if (dat_entry) {
|
||||
if (!batadv_compare_eth(dat_entry->mac_addr, mac_addr))
|
||||
memcpy(dat_entry->mac_addr, mac_addr, ETH_ALEN);
|
||||
ether_addr_copy(dat_entry->mac_addr, mac_addr);
|
||||
dat_entry->last_update = jiffies;
|
||||
batadv_dbg(BATADV_DBG_DAT, bat_priv,
|
||||
"Entry updated: %pI4 %pM (vid: %d)\n",
|
||||
@@ -292,7 +292,7 @@ static void batadv_dat_entry_add(struct batadv_priv *bat_priv, __be32 ip,
|
||||
|
||||
dat_entry->ip = ip;
|
||||
dat_entry->vid = vid;
|
||||
memcpy(dat_entry->mac_addr, mac_addr, ETH_ALEN);
|
||||
ether_addr_copy(dat_entry->mac_addr, mac_addr);
|
||||
dat_entry->last_update = jiffies;
|
||||
atomic_set(&dat_entry->refcount, 2);
|
||||
|
||||
@@ -1027,6 +1027,11 @@ bool batadv_dat_snoop_incoming_arp_request(struct batadv_priv *bat_priv,
|
||||
if (!skb_new)
|
||||
goto out;
|
||||
|
||||
/* the rest of the TX path assumes that the mac_header offset pointing
|
||||
* to the inner Ethernet header has been set, therefore reset it now.
|
||||
*/
|
||||
skb_reset_mac_header(skb_new);
|
||||
|
||||
if (vid & BATADV_VLAN_HAS_TAG)
|
||||
skb_new = vlan_insert_tag(skb_new, htons(ETH_P_8021Q),
|
||||
vid & VLAN_VID_MASK);
|
||||
|
||||
@@ -25,6 +25,9 @@
|
||||
|
||||
#include <linux/if_arp.h>
|
||||
|
||||
/**
|
||||
* BATADV_DAT_ADDR_MAX - maximum address value in the DHT space
|
||||
*/
|
||||
#define BATADV_DAT_ADDR_MAX ((batadv_dat_addr_t)~(batadv_dat_addr_t)0)
|
||||
|
||||
void batadv_dat_status_update(struct net_device *net_dev);
|
||||
|
||||
@@ -449,8 +449,8 @@ bool batadv_frag_send_packet(struct sk_buff *skb,
|
||||
frag_header.reserved = 0;
|
||||
frag_header.no = 0;
|
||||
frag_header.total_size = htons(skb->len);
|
||||
memcpy(frag_header.orig, primary_if->net_dev->dev_addr, ETH_ALEN);
|
||||
memcpy(frag_header.dest, orig_node->orig, ETH_ALEN);
|
||||
ether_addr_copy(frag_header.orig, primary_if->net_dev->dev_addr);
|
||||
ether_addr_copy(frag_header.dest, orig_node->orig);
|
||||
|
||||
/* Eat and send fragments from the tail of skb */
|
||||
while (skb->len > max_fragment_size) {
|
||||
|
||||
@@ -389,8 +389,6 @@ out:
|
||||
batadv_neigh_ifinfo_free_ref(router_gw_tq);
|
||||
if (router_orig_tq)
|
||||
batadv_neigh_ifinfo_free_ref(router_orig_tq);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -680,7 +678,7 @@ batadv_gw_dhcp_recipient_get(struct sk_buff *skb, unsigned int *header_len,
|
||||
if (!pskb_may_pull(skb, *header_len + ETH_HLEN))
|
||||
return BATADV_DHCP_NO;
|
||||
|
||||
ethhdr = (struct ethhdr *)skb->data;
|
||||
ethhdr = eth_hdr(skb);
|
||||
proto = ethhdr->h_proto;
|
||||
*header_len += ETH_HLEN;
|
||||
|
||||
@@ -689,7 +687,7 @@ batadv_gw_dhcp_recipient_get(struct sk_buff *skb, unsigned int *header_len,
|
||||
if (!pskb_may_pull(skb, *header_len + VLAN_HLEN))
|
||||
return BATADV_DHCP_NO;
|
||||
|
||||
vhdr = (struct vlan_ethhdr *)skb->data;
|
||||
vhdr = vlan_eth_hdr(skb);
|
||||
proto = vhdr->h_vlan_encapsulated_proto;
|
||||
*header_len += VLAN_HLEN;
|
||||
}
|
||||
@@ -728,7 +726,7 @@ batadv_gw_dhcp_recipient_get(struct sk_buff *skb, unsigned int *header_len,
|
||||
return BATADV_DHCP_NO;
|
||||
|
||||
/* skb->data might have been reallocated by pskb_may_pull() */
|
||||
ethhdr = (struct ethhdr *)skb->data;
|
||||
ethhdr = eth_hdr(skb);
|
||||
if (ntohs(ethhdr->h_proto) == ETH_P_8021Q)
|
||||
ethhdr = (struct ethhdr *)(skb->data + VLAN_HLEN);
|
||||
|
||||
@@ -765,7 +763,7 @@ batadv_gw_dhcp_recipient_get(struct sk_buff *skb, unsigned int *header_len,
|
||||
if (*p != ETH_ALEN)
|
||||
return BATADV_DHCP_NO;
|
||||
|
||||
memcpy(chaddr, skb->data + chaddr_offset, ETH_ALEN);
|
||||
ether_addr_copy(chaddr, skb->data + chaddr_offset);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
@@ -158,6 +158,7 @@ static ssize_t batadv_socket_write(struct file *file, const char __user *buff,
|
||||
struct batadv_orig_node *orig_node = NULL;
|
||||
struct batadv_neigh_node *neigh_node = NULL;
|
||||
size_t packet_len = sizeof(struct batadv_icmp_packet);
|
||||
uint8_t *addr;
|
||||
|
||||
if (len < sizeof(struct batadv_icmp_header)) {
|
||||
batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
|
||||
@@ -227,10 +228,10 @@ static ssize_t batadv_socket_write(struct file *file, const char __user *buff,
|
||||
goto dst_unreach;
|
||||
|
||||
icmp_packet_rr = (struct batadv_icmp_packet_rr *)icmp_header;
|
||||
if (packet_len == sizeof(*icmp_packet_rr))
|
||||
memcpy(icmp_packet_rr->rr,
|
||||
neigh_node->if_incoming->net_dev->dev_addr,
|
||||
ETH_ALEN);
|
||||
if (packet_len == sizeof(*icmp_packet_rr)) {
|
||||
addr = neigh_node->if_incoming->net_dev->dev_addr;
|
||||
ether_addr_copy(icmp_packet_rr->rr[0], addr);
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
@@ -250,7 +251,7 @@ static ssize_t batadv_socket_write(struct file *file, const char __user *buff,
|
||||
goto free_skb;
|
||||
}
|
||||
|
||||
memcpy(icmp_header->orig, primary_if->net_dev->dev_addr, ETH_ALEN);
|
||||
ether_addr_copy(icmp_header->orig, primary_if->net_dev->dev_addr);
|
||||
|
||||
batadv_send_skb_packet(skb, neigh_node->if_incoming, neigh_node->addr);
|
||||
goto out;
|
||||
|
||||
+17
-2
@@ -34,6 +34,7 @@
|
||||
#include "gateway_client.h"
|
||||
#include "bridge_loop_avoidance.h"
|
||||
#include "distributed-arp-table.h"
|
||||
#include "multicast.h"
|
||||
#include "gateway_common.h"
|
||||
#include "hash.h"
|
||||
#include "bat_algo.h"
|
||||
@@ -110,6 +111,9 @@ int batadv_mesh_init(struct net_device *soft_iface)
|
||||
spin_lock_init(&bat_priv->tt.last_changeset_lock);
|
||||
spin_lock_init(&bat_priv->tt.commit_lock);
|
||||
spin_lock_init(&bat_priv->gw.list_lock);
|
||||
#ifdef CONFIG_BATMAN_ADV_MCAST
|
||||
spin_lock_init(&bat_priv->mcast.want_lists_lock);
|
||||
#endif
|
||||
spin_lock_init(&bat_priv->tvlv.container_list_lock);
|
||||
spin_lock_init(&bat_priv->tvlv.handler_list_lock);
|
||||
spin_lock_init(&bat_priv->softif_vlan_list_lock);
|
||||
@@ -117,9 +121,17 @@ int batadv_mesh_init(struct net_device *soft_iface)
|
||||
INIT_HLIST_HEAD(&bat_priv->forw_bat_list);
|
||||
INIT_HLIST_HEAD(&bat_priv->forw_bcast_list);
|
||||
INIT_HLIST_HEAD(&bat_priv->gw.list);
|
||||
#ifdef CONFIG_BATMAN_ADV_MCAST
|
||||
INIT_HLIST_HEAD(&bat_priv->mcast.want_all_unsnoopables_list);
|
||||
INIT_HLIST_HEAD(&bat_priv->mcast.want_all_ipv4_list);
|
||||
INIT_HLIST_HEAD(&bat_priv->mcast.want_all_ipv6_list);
|
||||
#endif
|
||||
INIT_LIST_HEAD(&bat_priv->tt.changes_list);
|
||||
INIT_LIST_HEAD(&bat_priv->tt.req_list);
|
||||
INIT_LIST_HEAD(&bat_priv->tt.roam_list);
|
||||
#ifdef CONFIG_BATMAN_ADV_MCAST
|
||||
INIT_HLIST_HEAD(&bat_priv->mcast.mla_list);
|
||||
#endif
|
||||
INIT_HLIST_HEAD(&bat_priv->tvlv.container_list);
|
||||
INIT_HLIST_HEAD(&bat_priv->tvlv.handler_list);
|
||||
INIT_HLIST_HEAD(&bat_priv->softif_vlan_list);
|
||||
@@ -145,6 +157,7 @@ int batadv_mesh_init(struct net_device *soft_iface)
|
||||
goto err;
|
||||
|
||||
batadv_gw_init(bat_priv);
|
||||
batadv_mcast_init(bat_priv);
|
||||
|
||||
atomic_set(&bat_priv->gw.reselect, 0);
|
||||
atomic_set(&bat_priv->mesh_state, BATADV_MESH_ACTIVE);
|
||||
@@ -169,6 +182,8 @@ void batadv_mesh_free(struct net_device *soft_iface)
|
||||
batadv_dat_free(bat_priv);
|
||||
batadv_bla_free(bat_priv);
|
||||
|
||||
batadv_mcast_free(bat_priv);
|
||||
|
||||
/* Free the TT and the originator tables only after having terminated
|
||||
* all the other depending components which may use these structures for
|
||||
* their purposes.
|
||||
@@ -1133,8 +1148,8 @@ void batadv_tvlv_unicast_send(struct batadv_priv *bat_priv, uint8_t *src,
|
||||
unicast_tvlv_packet->reserved = 0;
|
||||
unicast_tvlv_packet->tvlv_len = htons(tvlv_len);
|
||||
unicast_tvlv_packet->align = 0;
|
||||
memcpy(unicast_tvlv_packet->src, src, ETH_ALEN);
|
||||
memcpy(unicast_tvlv_packet->dst, dst, ETH_ALEN);
|
||||
ether_addr_copy(unicast_tvlv_packet->src, src);
|
||||
ether_addr_copy(unicast_tvlv_packet->dst, dst);
|
||||
|
||||
tvlv_buff = (unsigned char *)(unicast_tvlv_packet + 1);
|
||||
tvlv_hdr = (struct batadv_tvlv_hdr *)tvlv_buff;
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#define BATADV_DRIVER_DEVICE "batman-adv"
|
||||
|
||||
#ifndef BATADV_SOURCE_VERSION
|
||||
#define BATADV_SOURCE_VERSION "2014.1.0"
|
||||
#define BATADV_SOURCE_VERSION "2014.2.0"
|
||||
#endif
|
||||
|
||||
/* B.A.T.M.A.N. parameters */
|
||||
@@ -176,6 +176,8 @@ enum batadv_uev_type {
|
||||
#include <linux/percpu.h>
|
||||
#include <linux/slab.h>
|
||||
#include <net/sock.h> /* struct sock */
|
||||
#include <net/addrconf.h> /* ipv6 address stuff */
|
||||
#include <linux/ip.h>
|
||||
#include <net/rtnetlink.h>
|
||||
#include <linux/jiffies.h>
|
||||
#include <linux/seq_file.h>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user