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 commit 'v2.6.26' into bkl-removal
This commit is contained in:
+25
-3
@@ -382,6 +382,18 @@ static void vlan_sync_address(struct net_device *dev,
|
||||
memcpy(vlan->real_dev_addr, dev->dev_addr, ETH_ALEN);
|
||||
}
|
||||
|
||||
static void vlan_transfer_features(struct net_device *dev,
|
||||
struct net_device *vlandev)
|
||||
{
|
||||
unsigned long old_features = vlandev->features;
|
||||
|
||||
vlandev->features &= ~dev->vlan_features;
|
||||
vlandev->features |= dev->features & dev->vlan_features;
|
||||
|
||||
if (old_features != vlandev->features)
|
||||
netdev_features_change(vlandev);
|
||||
}
|
||||
|
||||
static void __vlan_device_event(struct net_device *dev, unsigned long event)
|
||||
{
|
||||
switch (event) {
|
||||
@@ -410,10 +422,8 @@ static int vlan_device_event(struct notifier_block *unused, unsigned long event,
|
||||
int i, flgs;
|
||||
struct net_device *vlandev;
|
||||
|
||||
if (is_vlan_dev(dev)) {
|
||||
if (is_vlan_dev(dev))
|
||||
__vlan_device_event(dev, event);
|
||||
goto out;
|
||||
}
|
||||
|
||||
grp = __vlan_find_group(dev);
|
||||
if (!grp)
|
||||
@@ -450,6 +460,18 @@ static int vlan_device_event(struct notifier_block *unused, unsigned long event,
|
||||
}
|
||||
break;
|
||||
|
||||
case NETDEV_FEAT_CHANGE:
|
||||
/* Propagate device features to underlying device */
|
||||
for (i = 0; i < VLAN_GROUP_ARRAY_LEN; i++) {
|
||||
vlandev = vlan_group_get_device(grp, i);
|
||||
if (!vlandev)
|
||||
continue;
|
||||
|
||||
vlan_transfer_features(dev, vlandev);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case NETDEV_DOWN:
|
||||
/* Put all VLANs for this dev in the down state too. */
|
||||
for (i = 0; i < VLAN_GROUP_ARRAY_LEN; i++) {
|
||||
|
||||
@@ -663,6 +663,8 @@ static int vlan_dev_init(struct net_device *dev)
|
||||
(1<<__LINK_STATE_DORMANT))) |
|
||||
(1<<__LINK_STATE_PRESENT);
|
||||
|
||||
dev->features |= real_dev->features & real_dev->vlan_features;
|
||||
|
||||
/* ipv6 shared card related stuff */
|
||||
dev->dev_id = real_dev->dev_id;
|
||||
|
||||
|
||||
+45
-33
@@ -188,10 +188,13 @@ static int br2684_xmit_vcc(struct sk_buff *skb, struct br2684_dev *brdev,
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
skb_push(skb, 2);
|
||||
if (brdev->payload == p_bridged)
|
||||
} else { /* e_vc */
|
||||
if (brdev->payload == p_bridged) {
|
||||
skb_push(skb, 2);
|
||||
memset(skb->data, 0, 2);
|
||||
} else { /* p_routed */
|
||||
skb_pull(skb, ETH_HLEN);
|
||||
}
|
||||
}
|
||||
skb_debug(skb);
|
||||
|
||||
@@ -377,11 +380,8 @@ static void br2684_push(struct atm_vcc *atmvcc, struct sk_buff *skb)
|
||||
(skb->data + 6, ethertype_ipv4,
|
||||
sizeof(ethertype_ipv4)) == 0)
|
||||
skb->protocol = __constant_htons(ETH_P_IP);
|
||||
else {
|
||||
brdev->stats.rx_errors++;
|
||||
dev_kfree_skb(skb);
|
||||
return;
|
||||
}
|
||||
else
|
||||
goto error;
|
||||
skb_pull(skb, sizeof(llc_oui_ipv4));
|
||||
skb_reset_network_header(skb);
|
||||
skb->pkt_type = PACKET_HOST;
|
||||
@@ -394,44 +394,56 @@ static void br2684_push(struct atm_vcc *atmvcc, struct sk_buff *skb)
|
||||
(memcmp(skb->data, llc_oui_pid_pad, 7) == 0)) {
|
||||
skb_pull(skb, sizeof(llc_oui_pid_pad));
|
||||
skb->protocol = eth_type_trans(skb, net_dev);
|
||||
} else {
|
||||
brdev->stats.rx_errors++;
|
||||
dev_kfree_skb(skb);
|
||||
return;
|
||||
}
|
||||
} else
|
||||
goto error;
|
||||
|
||||
} else {
|
||||
/* first 2 chars should be 0 */
|
||||
if (*((u16 *) (skb->data)) != 0) {
|
||||
brdev->stats.rx_errors++;
|
||||
dev_kfree_skb(skb);
|
||||
return;
|
||||
} else { /* e_vc */
|
||||
if (brdev->payload == p_routed) {
|
||||
struct iphdr *iph;
|
||||
|
||||
skb_reset_network_header(skb);
|
||||
iph = ip_hdr(skb);
|
||||
if (iph->version == 4)
|
||||
skb->protocol = __constant_htons(ETH_P_IP);
|
||||
else if (iph->version == 6)
|
||||
skb->protocol = __constant_htons(ETH_P_IPV6);
|
||||
else
|
||||
goto error;
|
||||
skb->pkt_type = PACKET_HOST;
|
||||
} else { /* p_bridged */
|
||||
/* first 2 chars should be 0 */
|
||||
if (*((u16 *) (skb->data)) != 0)
|
||||
goto error;
|
||||
skb_pull(skb, BR2684_PAD_LEN);
|
||||
skb->protocol = eth_type_trans(skb, net_dev);
|
||||
}
|
||||
skb_pull(skb, BR2684_PAD_LEN + ETH_HLEN); /* pad, dstmac, srcmac, ethtype */
|
||||
skb->protocol = eth_type_trans(skb, net_dev);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_ATM_BR2684_IPFILTER
|
||||
if (unlikely(packet_fails_filter(skb->protocol, brvcc, skb))) {
|
||||
brdev->stats.rx_dropped++;
|
||||
dev_kfree_skb(skb);
|
||||
return;
|
||||
}
|
||||
if (unlikely(packet_fails_filter(skb->protocol, brvcc, skb)))
|
||||
goto dropped;
|
||||
#endif /* CONFIG_ATM_BR2684_IPFILTER */
|
||||
skb->dev = net_dev;
|
||||
ATM_SKB(skb)->vcc = atmvcc; /* needed ? */
|
||||
pr_debug("received packet's protocol: %x\n", ntohs(skb->protocol));
|
||||
skb_debug(skb);
|
||||
if (unlikely(!(net_dev->flags & IFF_UP))) {
|
||||
/* sigh, interface is down */
|
||||
brdev->stats.rx_dropped++;
|
||||
dev_kfree_skb(skb);
|
||||
return;
|
||||
}
|
||||
/* sigh, interface is down? */
|
||||
if (unlikely(!(net_dev->flags & IFF_UP)))
|
||||
goto dropped;
|
||||
brdev->stats.rx_packets++;
|
||||
brdev->stats.rx_bytes += skb->len;
|
||||
memset(ATM_SKB(skb), 0, sizeof(struct atm_skb_data));
|
||||
netif_rx(skb);
|
||||
return;
|
||||
|
||||
dropped:
|
||||
brdev->stats.rx_dropped++;
|
||||
goto free_skb;
|
||||
error:
|
||||
brdev->stats.rx_errors++;
|
||||
free_skb:
|
||||
dev_kfree_skb(skb);
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -518,9 +530,9 @@ static int br2684_regvcc(struct atm_vcc *atmvcc, void __user * arg)
|
||||
struct sk_buff *next = skb->next;
|
||||
|
||||
skb->next = skb->prev = NULL;
|
||||
br2684_push(atmvcc, skb);
|
||||
BRPRIV(skb->dev)->stats.rx_bytes -= skb->len;
|
||||
BRPRIV(skb->dev)->stats.rx_packets--;
|
||||
br2684_push(atmvcc, skb);
|
||||
|
||||
skb = next;
|
||||
}
|
||||
|
||||
@@ -64,20 +64,15 @@ void ax25_frames_acked(ax25_cb *ax25, unsigned short nr)
|
||||
|
||||
void ax25_requeue_frames(ax25_cb *ax25)
|
||||
{
|
||||
struct sk_buff *skb, *skb_prev = NULL;
|
||||
struct sk_buff *skb;
|
||||
|
||||
/*
|
||||
* Requeue all the un-ack-ed frames on the output queue to be picked
|
||||
* up by ax25_kick called from the timer. This arrangement handles the
|
||||
* possibility of an empty output queue.
|
||||
*/
|
||||
while ((skb = skb_dequeue(&ax25->ack_queue)) != NULL) {
|
||||
if (skb_prev == NULL)
|
||||
skb_queue_head(&ax25->write_queue, skb);
|
||||
else
|
||||
skb_append(skb_prev, skb, &ax25->write_queue);
|
||||
skb_prev = skb;
|
||||
}
|
||||
while ((skb = skb_dequeue_tail(&ax25->ack_queue)) != NULL)
|
||||
skb_queue_head(&ax25->write_queue, skb);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -423,8 +423,8 @@ static int __rfcomm_dlc_close(struct rfcomm_dlc *d, int err)
|
||||
|
||||
rfcomm_dlc_lock(d);
|
||||
d->state = BT_CLOSED;
|
||||
rfcomm_dlc_unlock(d);
|
||||
d->state_change(d, err);
|
||||
rfcomm_dlc_unlock(d);
|
||||
|
||||
skb_queue_purge(&d->tx_queue);
|
||||
rfcomm_dlc_unlink(d);
|
||||
|
||||
@@ -566,11 +566,22 @@ static void rfcomm_dev_state_change(struct rfcomm_dlc *dlc, int err)
|
||||
if (dlc->state == BT_CLOSED) {
|
||||
if (!dev->tty) {
|
||||
if (test_bit(RFCOMM_RELEASE_ONHUP, &dev->flags)) {
|
||||
if (rfcomm_dev_get(dev->id) == NULL)
|
||||
/* Drop DLC lock here to avoid deadlock
|
||||
* 1. rfcomm_dev_get will take rfcomm_dev_lock
|
||||
* but in rfcomm_dev_add there's lock order:
|
||||
* rfcomm_dev_lock -> dlc lock
|
||||
* 2. rfcomm_dev_put will deadlock if it's
|
||||
* the last reference
|
||||
*/
|
||||
rfcomm_dlc_unlock(dlc);
|
||||
if (rfcomm_dev_get(dev->id) == NULL) {
|
||||
rfcomm_dlc_lock(dlc);
|
||||
return;
|
||||
}
|
||||
|
||||
rfcomm_dev_del(dev);
|
||||
rfcomm_dev_put(dev);
|
||||
rfcomm_dlc_lock(dlc);
|
||||
}
|
||||
} else
|
||||
tty_hangup(dev->tty);
|
||||
|
||||
+7
-3
@@ -442,12 +442,16 @@ int br_del_if(struct net_bridge *br, struct net_device *dev)
|
||||
|
||||
void __exit br_cleanup_bridges(void)
|
||||
{
|
||||
struct net_device *dev, *nxt;
|
||||
struct net_device *dev;
|
||||
|
||||
rtnl_lock();
|
||||
for_each_netdev_safe(&init_net, dev, nxt)
|
||||
if (dev->priv_flags & IFF_EBRIDGE)
|
||||
restart:
|
||||
for_each_netdev(&init_net, dev) {
|
||||
if (dev->priv_flags & IFF_EBRIDGE) {
|
||||
del_br(dev->priv);
|
||||
goto restart;
|
||||
}
|
||||
}
|
||||
rtnl_unlock();
|
||||
|
||||
}
|
||||
|
||||
@@ -205,12 +205,19 @@ static int can_create(struct net *net, struct socket *sock, int protocol)
|
||||
* -ENOBUFS on full driver queue (see net_xmit_errno())
|
||||
* -ENOMEM when local loopback failed at calling skb_clone()
|
||||
* -EPERM when trying to send on a non-CAN interface
|
||||
* -EINVAL when the skb->data does not contain a valid CAN frame
|
||||
*/
|
||||
int can_send(struct sk_buff *skb, int loop)
|
||||
{
|
||||
struct sk_buff *newskb = NULL;
|
||||
struct can_frame *cf = (struct can_frame *)skb->data;
|
||||
int err;
|
||||
|
||||
if (skb->len != sizeof(struct can_frame) || cf->can_dlc > 8) {
|
||||
kfree_skb(skb);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (skb->dev->type != ARPHRD_CAN) {
|
||||
kfree_skb(skb);
|
||||
return -EPERM;
|
||||
@@ -605,6 +612,7 @@ static int can_rcv(struct sk_buff *skb, struct net_device *dev,
|
||||
struct packet_type *pt, struct net_device *orig_dev)
|
||||
{
|
||||
struct dev_rcv_lists *d;
|
||||
struct can_frame *cf = (struct can_frame *)skb->data;
|
||||
int matches;
|
||||
|
||||
if (dev->type != ARPHRD_CAN || dev_net(dev) != &init_net) {
|
||||
@@ -612,6 +620,8 @@ static int can_rcv(struct sk_buff *skb, struct net_device *dev,
|
||||
return 0;
|
||||
}
|
||||
|
||||
BUG_ON(skb->len != sizeof(struct can_frame) || cf->can_dlc > 8);
|
||||
|
||||
/* update statistics */
|
||||
can_stats.rx_frames++;
|
||||
can_stats.rx_frames_delta++;
|
||||
|
||||
+19
-4
@@ -298,7 +298,7 @@ static void bcm_send_to_user(struct bcm_op *op, struct bcm_msg_head *head,
|
||||
|
||||
if (head->nframes) {
|
||||
/* can_frames starting here */
|
||||
firstframe = (struct can_frame *) skb_tail_pointer(skb);
|
||||
firstframe = (struct can_frame *)skb_tail_pointer(skb);
|
||||
|
||||
memcpy(skb_put(skb, datalen), frames, datalen);
|
||||
|
||||
@@ -826,6 +826,10 @@ static int bcm_tx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg,
|
||||
for (i = 0; i < msg_head->nframes; i++) {
|
||||
err = memcpy_fromiovec((u8 *)&op->frames[i],
|
||||
msg->msg_iov, CFSIZ);
|
||||
|
||||
if (op->frames[i].can_dlc > 8)
|
||||
err = -EINVAL;
|
||||
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
@@ -858,6 +862,10 @@ static int bcm_tx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg,
|
||||
for (i = 0; i < msg_head->nframes; i++) {
|
||||
err = memcpy_fromiovec((u8 *)&op->frames[i],
|
||||
msg->msg_iov, CFSIZ);
|
||||
|
||||
if (op->frames[i].can_dlc > 8)
|
||||
err = -EINVAL;
|
||||
|
||||
if (err < 0) {
|
||||
if (op->frames != &op->sframe)
|
||||
kfree(op->frames);
|
||||
@@ -1164,9 +1172,12 @@ static int bcm_tx_send(struct msghdr *msg, int ifindex, struct sock *sk)
|
||||
|
||||
skb->dev = dev;
|
||||
skb->sk = sk;
|
||||
can_send(skb, 1); /* send with loopback */
|
||||
err = can_send(skb, 1); /* send with loopback */
|
||||
dev_put(dev);
|
||||
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
return CFSIZ + MHSIZ;
|
||||
}
|
||||
|
||||
@@ -1185,6 +1196,10 @@ static int bcm_sendmsg(struct kiocb *iocb, struct socket *sock,
|
||||
if (!bo->bound)
|
||||
return -ENOTCONN;
|
||||
|
||||
/* check for valid message length from userspace */
|
||||
if (size < MHSIZ || (size - MHSIZ) % CFSIZ)
|
||||
return -EINVAL;
|
||||
|
||||
/* check for alternative ifindex for this bcm_op */
|
||||
|
||||
if (!ifindex && msg->msg_name) {
|
||||
@@ -1259,8 +1274,8 @@ static int bcm_sendmsg(struct kiocb *iocb, struct socket *sock,
|
||||
break;
|
||||
|
||||
case TX_SEND:
|
||||
/* we need at least one can_frame */
|
||||
if (msg_head.nframes < 1)
|
||||
/* we need exactly one can_frame behind the msg head */
|
||||
if ((msg_head.nframes != 1) || (size != CFSIZ + MHSIZ))
|
||||
ret = -EINVAL;
|
||||
else
|
||||
ret = bcm_tx_send(msg, ifindex, sk);
|
||||
|
||||
@@ -632,6 +632,9 @@ static int raw_sendmsg(struct kiocb *iocb, struct socket *sock,
|
||||
} else
|
||||
ifindex = ro->ifindex;
|
||||
|
||||
if (size != sizeof(struct can_frame))
|
||||
return -EINVAL;
|
||||
|
||||
dev = dev_get_by_index(&init_net, ifindex);
|
||||
if (!dev)
|
||||
return -ENXIO;
|
||||
|
||||
+39
-13
@@ -119,6 +119,7 @@
|
||||
#include <linux/err.h>
|
||||
#include <linux/ctype.h>
|
||||
#include <linux/if_arp.h>
|
||||
#include <linux/if_vlan.h>
|
||||
|
||||
#include "net-sysfs.h"
|
||||
|
||||
@@ -453,7 +454,7 @@ static int netdev_boot_setup_add(char *name, struct ifmap *map)
|
||||
for (i = 0; i < NETDEV_BOOT_SETUP_MAX; i++) {
|
||||
if (s[i].name[0] == '\0' || s[i].name[0] == ' ') {
|
||||
memset(s[i].name, 0, sizeof(s[i].name));
|
||||
strcpy(s[i].name, name);
|
||||
strlcpy(s[i].name, name, IFNAMSIZ);
|
||||
memcpy(&s[i].map, map, sizeof(s[i].map));
|
||||
break;
|
||||
}
|
||||
@@ -478,7 +479,7 @@ int netdev_boot_setup_check(struct net_device *dev)
|
||||
|
||||
for (i = 0; i < NETDEV_BOOT_SETUP_MAX; i++) {
|
||||
if (s[i].name[0] != '\0' && s[i].name[0] != ' ' &&
|
||||
!strncmp(dev->name, s[i].name, strlen(s[i].name))) {
|
||||
!strcmp(dev->name, s[i].name)) {
|
||||
dev->irq = s[i].map.irq;
|
||||
dev->base_addr = s[i].map.base_addr;
|
||||
dev->mem_start = s[i].map.mem_start;
|
||||
@@ -903,7 +904,11 @@ int dev_change_name(struct net_device *dev, char *newname)
|
||||
strlcpy(dev->name, newname, IFNAMSIZ);
|
||||
|
||||
rollback:
|
||||
device_rename(&dev->dev, dev->name);
|
||||
err = device_rename(&dev->dev, dev->name);
|
||||
if (err) {
|
||||
memcpy(dev->name, oldname, IFNAMSIZ);
|
||||
return err;
|
||||
}
|
||||
|
||||
write_lock_bh(&dev_base_lock);
|
||||
hlist_del(&dev->name_hlist);
|
||||
@@ -1358,6 +1363,29 @@ void netif_device_attach(struct net_device *dev)
|
||||
}
|
||||
EXPORT_SYMBOL(netif_device_attach);
|
||||
|
||||
static bool can_checksum_protocol(unsigned long features, __be16 protocol)
|
||||
{
|
||||
return ((features & NETIF_F_GEN_CSUM) ||
|
||||
((features & NETIF_F_IP_CSUM) &&
|
||||
protocol == htons(ETH_P_IP)) ||
|
||||
((features & NETIF_F_IPV6_CSUM) &&
|
||||
protocol == htons(ETH_P_IPV6)));
|
||||
}
|
||||
|
||||
static bool dev_can_checksum(struct net_device *dev, struct sk_buff *skb)
|
||||
{
|
||||
if (can_checksum_protocol(dev->features, skb->protocol))
|
||||
return true;
|
||||
|
||||
if (skb->protocol == htons(ETH_P_8021Q)) {
|
||||
struct vlan_ethhdr *veh = (struct vlan_ethhdr *)skb->data;
|
||||
if (can_checksum_protocol(dev->features & dev->vlan_features,
|
||||
veh->h_vlan_encapsulated_proto))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* Invalidate hardware checksum when packet is to be mangled, and
|
||||
@@ -1636,14 +1664,8 @@ int dev_queue_xmit(struct sk_buff *skb)
|
||||
if (skb->ip_summed == CHECKSUM_PARTIAL) {
|
||||
skb_set_transport_header(skb, skb->csum_start -
|
||||
skb_headroom(skb));
|
||||
|
||||
if (!(dev->features & NETIF_F_GEN_CSUM) &&
|
||||
!((dev->features & NETIF_F_IP_CSUM) &&
|
||||
skb->protocol == htons(ETH_P_IP)) &&
|
||||
!((dev->features & NETIF_F_IPV6_CSUM) &&
|
||||
skb->protocol == htons(ETH_P_IPV6)))
|
||||
if (skb_checksum_help(skb))
|
||||
goto out_kfree_skb;
|
||||
if (!dev_can_checksum(dev, skb) && skb_checksum_help(skb))
|
||||
goto out_kfree_skb;
|
||||
}
|
||||
|
||||
gso:
|
||||
@@ -2055,6 +2077,10 @@ int netif_receive_skb(struct sk_buff *skb)
|
||||
|
||||
rcu_read_lock();
|
||||
|
||||
/* Don't receive packets in an exiting network namespace */
|
||||
if (!net_alive(dev_net(skb->dev)))
|
||||
goto out;
|
||||
|
||||
#ifdef CONFIG_NET_CLS_ACT
|
||||
if (skb->tc_verd & TC_NCLS) {
|
||||
skb->tc_verd = CLR_TC_NCLS(skb->tc_verd);
|
||||
@@ -2947,7 +2973,7 @@ EXPORT_SYMBOL(dev_unicast_delete);
|
||||
/**
|
||||
* dev_unicast_add - add a secondary unicast address
|
||||
* @dev: device
|
||||
* @addr: address to delete
|
||||
* @addr: address to add
|
||||
* @alen: length of @addr
|
||||
*
|
||||
* Add a secondary unicast address to the device or increase
|
||||
@@ -3137,7 +3163,7 @@ int dev_change_flags(struct net_device *dev, unsigned flags)
|
||||
* Load in the correct multicast list now the flags have changed.
|
||||
*/
|
||||
|
||||
if (dev->change_rx_flags && (dev->flags ^ flags) & IFF_MULTICAST)
|
||||
if (dev->change_rx_flags && (old_flags ^ flags) & IFF_MULTICAST)
|
||||
dev->change_rx_flags(dev, IFF_MULTICAST);
|
||||
|
||||
dev_set_rx_mode(dev);
|
||||
|
||||
@@ -226,7 +226,7 @@ static int fib_nl_newrule(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)
|
||||
|
||||
ops = lookup_rules_ops(net, frh->family);
|
||||
if (ops == NULL) {
|
||||
err = EAFNOSUPPORT;
|
||||
err = -EAFNOSUPPORT;
|
||||
goto errout;
|
||||
}
|
||||
|
||||
@@ -365,7 +365,7 @@ static int fib_nl_delrule(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)
|
||||
|
||||
ops = lookup_rules_ops(net, frh->family);
|
||||
if (ops == NULL) {
|
||||
err = EAFNOSUPPORT;
|
||||
err = -EAFNOSUPPORT;
|
||||
goto errout;
|
||||
}
|
||||
|
||||
|
||||
@@ -68,7 +68,6 @@ static inline void *load_pointer(struct sk_buff *skb, int k,
|
||||
* sk_filter - run a packet through a socket filter
|
||||
* @sk: sock associated with &sk_buff
|
||||
* @skb: buffer to filter
|
||||
* @needlock: set to 1 if the sock is not locked by caller.
|
||||
*
|
||||
* Run the filter code and then cut skb->data to correct size returned by
|
||||
* sk_run_filter. If pkt_len is 0 we toss packet. If skb->len is smaller
|
||||
|
||||
@@ -1714,7 +1714,8 @@ static int neightbl_fill_parms(struct sk_buff *skb, struct neigh_parms *parms)
|
||||
return nla_nest_end(skb, nest);
|
||||
|
||||
nla_put_failure:
|
||||
return nla_nest_cancel(skb, nest);
|
||||
nla_nest_cancel(skb, nest);
|
||||
return -EMSGSIZE;
|
||||
}
|
||||
|
||||
static int neightbl_fill_info(struct sk_buff *skb, struct neigh_table *tbl,
|
||||
@@ -2057,9 +2058,9 @@ static int neigh_fill_info(struct sk_buff *skb, struct neighbour *neigh,
|
||||
goto nla_put_failure;
|
||||
}
|
||||
|
||||
ci.ndm_used = now - neigh->used;
|
||||
ci.ndm_confirmed = now - neigh->confirmed;
|
||||
ci.ndm_updated = now - neigh->updated;
|
||||
ci.ndm_used = jiffies_to_clock_t(now - neigh->used);
|
||||
ci.ndm_confirmed = jiffies_to_clock_t(now - neigh->confirmed);
|
||||
ci.ndm_updated = jiffies_to_clock_t(now - neigh->updated);
|
||||
ci.ndm_refcnt = atomic_read(&neigh->refcnt) - 1;
|
||||
read_unlock_bh(&neigh->lock);
|
||||
|
||||
|
||||
@@ -140,6 +140,9 @@ static void cleanup_net(struct work_struct *work)
|
||||
struct pernet_operations *ops;
|
||||
struct net *net;
|
||||
|
||||
/* Be very certain incoming network packets will not find us */
|
||||
rcu_barrier();
|
||||
|
||||
net = container_of(work, struct net, work);
|
||||
|
||||
mutex_lock(&net_mutex);
|
||||
|
||||
@@ -390,6 +390,7 @@ struct pktgen_thread {
|
||||
int cpu;
|
||||
|
||||
wait_queue_head_t queue;
|
||||
struct completion start_done;
|
||||
};
|
||||
|
||||
#define REMOVE 1
|
||||
@@ -3414,6 +3415,7 @@ static int pktgen_thread_worker(void *arg)
|
||||
BUG_ON(smp_processor_id() != cpu);
|
||||
|
||||
init_waitqueue_head(&t->queue);
|
||||
complete(&t->start_done);
|
||||
|
||||
pr_debug("pktgen: starting pktgen/%d: pid=%d\n", cpu, task_pid_nr(current));
|
||||
|
||||
@@ -3615,6 +3617,7 @@ static int __init pktgen_create_thread(int cpu)
|
||||
INIT_LIST_HEAD(&t->if_list);
|
||||
|
||||
list_add_tail(&t->th_list, &pktgen_threads);
|
||||
init_completion(&t->start_done);
|
||||
|
||||
p = kthread_create(pktgen_thread_worker, t, "kpktgend_%d", cpu);
|
||||
if (IS_ERR(p)) {
|
||||
@@ -3639,6 +3642,7 @@ static int __init pktgen_create_thread(int cpu)
|
||||
}
|
||||
|
||||
wake_up_process(p);
|
||||
wait_for_completion(&t->start_done);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -498,7 +498,8 @@ int rtnetlink_put_metrics(struct sk_buff *skb, u32 *metrics)
|
||||
return nla_nest_end(skb, mx);
|
||||
|
||||
nla_put_failure:
|
||||
return nla_nest_cancel(skb, mx);
|
||||
nla_nest_cancel(skb, mx);
|
||||
return -EMSGSIZE;
|
||||
}
|
||||
|
||||
int rtnl_put_cacheinfo(struct sk_buff *skb, struct dst_entry *dst, u32 id,
|
||||
|
||||
+15
-7
@@ -1292,12 +1292,14 @@ static int __skb_splice_bits(struct sk_buff *skb, unsigned int *offset,
|
||||
{
|
||||
unsigned int nr_pages = spd->nr_pages;
|
||||
unsigned int poff, plen, len, toff, tlen;
|
||||
int headlen, seg;
|
||||
int headlen, seg, error = 0;
|
||||
|
||||
toff = *offset;
|
||||
tlen = *total_len;
|
||||
if (!tlen)
|
||||
if (!tlen) {
|
||||
error = 1;
|
||||
goto err;
|
||||
}
|
||||
|
||||
/*
|
||||
* if the offset is greater than the linear part, go directly to
|
||||
@@ -1339,7 +1341,8 @@ static int __skb_splice_bits(struct sk_buff *skb, unsigned int *offset,
|
||||
* just jump directly to update and return, no point
|
||||
* in going over fragments when the output is full.
|
||||
*/
|
||||
if (spd_fill_page(spd, virt_to_page(p), plen, poff, skb))
|
||||
error = spd_fill_page(spd, virt_to_page(p), plen, poff, skb);
|
||||
if (error)
|
||||
goto done;
|
||||
|
||||
tlen -= plen;
|
||||
@@ -1369,7 +1372,8 @@ map_frag:
|
||||
if (!plen)
|
||||
break;
|
||||
|
||||
if (spd_fill_page(spd, f->page, plen, poff, skb))
|
||||
error = spd_fill_page(spd, f->page, plen, poff, skb);
|
||||
if (error)
|
||||
break;
|
||||
|
||||
tlen -= plen;
|
||||
@@ -1382,7 +1386,10 @@ done:
|
||||
return 0;
|
||||
}
|
||||
err:
|
||||
return 1;
|
||||
/* update the offset to reflect the linear part skip, if any */
|
||||
if (!error)
|
||||
*offset = toff;
|
||||
return error;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1445,6 +1452,7 @@ done:
|
||||
|
||||
if (spd.nr_pages) {
|
||||
int ret;
|
||||
struct sock *sk = __skb->sk;
|
||||
|
||||
/*
|
||||
* Drop the socket lock, otherwise we have reverse
|
||||
@@ -1455,9 +1463,9 @@ done:
|
||||
* we call into ->sendpage() with the i_mutex lock held
|
||||
* and networking will grab the socket lock.
|
||||
*/
|
||||
release_sock(__skb->sk);
|
||||
release_sock(sk);
|
||||
ret = splice_to_pipe(pipe, &spd);
|
||||
lock_sock(__skb->sk);
|
||||
lock_sock(sk);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -75,7 +75,7 @@ int dma_skb_copy_datagram_iovec(struct dma_chan *chan,
|
||||
|
||||
end = start + skb_shinfo(skb)->frags[i].size;
|
||||
copy = end - offset;
|
||||
if ((copy = end - offset) > 0) {
|
||||
if (copy > 0) {
|
||||
skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
|
||||
struct page *page = frag->page;
|
||||
|
||||
|
||||
+2
-27
@@ -290,12 +290,12 @@ int dccp_ackvec_add(struct dccp_ackvec *av, const struct sock *sk,
|
||||
|
||||
while (1) {
|
||||
const u8 len = dccp_ackvec_len(av, index);
|
||||
const u8 state = dccp_ackvec_state(av, index);
|
||||
const u8 av_state = dccp_ackvec_state(av, index);
|
||||
/*
|
||||
* valid packets not yet in av_buf have a reserved
|
||||
* entry, with a len equal to 0.
|
||||
*/
|
||||
if (state == DCCP_ACKVEC_STATE_NOT_RECEIVED &&
|
||||
if (av_state == DCCP_ACKVEC_STATE_NOT_RECEIVED &&
|
||||
len == 0 && delta == 0) { /* Found our
|
||||
reserved seat! */
|
||||
dccp_pr_debug("Found %llu reserved seat!\n",
|
||||
@@ -325,31 +325,6 @@ out_duplicate:
|
||||
return -EILSEQ;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_IP_DCCP_DEBUG
|
||||
void dccp_ackvector_print(const u64 ackno, const unsigned char *vector, int len)
|
||||
{
|
||||
dccp_pr_debug_cat("ACK vector len=%d, ackno=%llu |", len,
|
||||
(unsigned long long)ackno);
|
||||
|
||||
while (len--) {
|
||||
const u8 state = (*vector & DCCP_ACKVEC_STATE_MASK) >> 6;
|
||||
const u8 rl = *vector & DCCP_ACKVEC_LEN_MASK;
|
||||
|
||||
dccp_pr_debug_cat("%d,%d|", state, rl);
|
||||
++vector;
|
||||
}
|
||||
|
||||
dccp_pr_debug_cat("\n");
|
||||
}
|
||||
|
||||
void dccp_ackvec_print(const struct dccp_ackvec *av)
|
||||
{
|
||||
dccp_ackvector_print(av->av_buf_ackno,
|
||||
av->av_buf + av->av_buf_head,
|
||||
av->av_vec_len);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void dccp_ackvec_throw_record(struct dccp_ackvec *av,
|
||||
struct dccp_ackvec_record *avr)
|
||||
{
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user