Skip to content

Commit

Permalink
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/…
Browse files Browse the repository at this point in the history
…davem/net-2.6

* 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6:
  [NET]: Mark Paul Moore as maintainer of labelled networking.
  [VLAN/BRIDGE]: Fix "skb_pull_rcsum - Fatal exception in interrupt"
  [ISDN]: Get rid of some pointless allocation casts in common and bsd comp.
  [NET]: Avoid pointless allocation casts in BSD compression module
  [IRDA]: Do not do pointless kmalloc return value cast in KingSun driver
  [NET]: Fix crash in dev_mc_sync()/dev_mc_unsync()
  [PPPOL2TP]: Fix endianness annotations.
  [IOAT]: ioatdma needs to to play nice in a multi-dma-client world
  [SLIP]: trivial sparse warning fix
  [EQL]: sparse warning fix
  [NET]: is_power_of_2 in net/core/neighbour.c
  [TCP]: Describe tcp_init_cwnd() thoroughly in a comment.
  [NET]: Fix IP_ADD/DROP_MEMBERSHIP to handle only connectionless
  [KBUILD]: Sanitize tc_ematch headers.
  [IPSEC] AH4: Update IPv4 options handling to conform to RFC 4302.
  • Loading branch information
Linus Torvalds committed Aug 27, 2007
2 parents d243769 + 10e2ff1 commit 28d9aa6
Show file tree
Hide file tree
Showing 18 changed files with 70 additions and 41 deletions.
6 changes: 6 additions & 0 deletions MAINTAINERS
Expand Up @@ -2661,6 +2661,12 @@ L: netdev@vger.kernel.org
T: git kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6.git
S: Maintained

NETWORKING [LABELED] (NetLabel, CIPSO, Labeled IPsec, SECMARK)
P: Paul Moore
M: paul.moore@hp.com
L: netdev@vger.kernel.org
S: Maintained

NETWORKING [WIRELESS]
P: John W. Linville
M: linville@tuxdriver.com
Expand Down
18 changes: 4 additions & 14 deletions drivers/dma/ioatdma.c
Expand Up @@ -191,17 +191,12 @@ static int ioat_dma_alloc_chan_resources(struct dma_chan *chan)
int i;
LIST_HEAD(tmp_list);

/*
* In-use bit automatically set by reading chanctrl
* If 0, we got it, if 1, someone else did
*/
chanctrl = readw(ioat_chan->reg_base + IOAT_CHANCTRL_OFFSET);
if (chanctrl & IOAT_CHANCTRL_CHANNEL_IN_USE)
return -EBUSY;
/* have we already been set up? */
if (!list_empty(&ioat_chan->free_desc))
return INITIAL_IOAT_DESC_COUNT;

/* Setup register to interrupt and write completion status on error */
chanctrl = IOAT_CHANCTRL_CHANNEL_IN_USE |
IOAT_CHANCTRL_ERR_INT_EN |
chanctrl = IOAT_CHANCTRL_ERR_INT_EN |
IOAT_CHANCTRL_ANY_ERR_ABORT_EN |
IOAT_CHANCTRL_ERR_COMPLETION_EN;
writew(chanctrl, ioat_chan->reg_base + IOAT_CHANCTRL_OFFSET);
Expand Down Expand Up @@ -282,11 +277,6 @@ static void ioat_dma_free_chan_resources(struct dma_chan *chan)
in_use_descs - 1);

ioat_chan->last_completion = ioat_chan->completion_addr = 0;

/* Tell hw the chan is free */
chanctrl = readw(ioat_chan->reg_base + IOAT_CHANCTRL_OFFSET);
chanctrl &= ~IOAT_CHANCTRL_CHANNEL_IN_USE;
writew(chanctrl, ioat_chan->reg_base + IOAT_CHANCTRL_OFFSET);
}

static struct dma_async_tx_descriptor *
Expand Down
5 changes: 2 additions & 3 deletions drivers/isdn/i4l/isdn_bsdcomp.c
Expand Up @@ -341,7 +341,7 @@ static void *bsd_alloc (struct isdn_ppp_comp_data *data)
* Allocate space for the dictionary. This may be more than one page in
* length.
*/
db->dict = (struct bsd_dict *) vmalloc (hsize * sizeof (struct bsd_dict));
db->dict = vmalloc(hsize * sizeof(struct bsd_dict));
if (!db->dict) {
bsd_free (db);
return NULL;
Expand All @@ -354,8 +354,7 @@ static void *bsd_alloc (struct isdn_ppp_comp_data *data)
if (!decomp)
db->lens = NULL;
else {
db->lens = (unsigned short *) vmalloc ((maxmaxcode + 1) *
sizeof (db->lens[0]));
db->lens = vmalloc((maxmaxcode + 1) * sizeof(db->lens[0]));
if (!db->lens) {
bsd_free (db);
return (NULL);
Expand Down
2 changes: 1 addition & 1 deletion drivers/isdn/i4l/isdn_common.c
Expand Up @@ -2291,7 +2291,7 @@ static int __init isdn_init(void)
int i;
char tmprev[50];

if (!(dev = (isdn_dev *) vmalloc(sizeof(isdn_dev)))) {
if (!(dev = vmalloc(sizeof(isdn_dev)))) {
printk(KERN_WARNING "isdn: Could not allocate device-struct.\n");
return -EIO;
}
Expand Down
6 changes: 2 additions & 4 deletions drivers/net/bsd_comp.c
Expand Up @@ -406,8 +406,7 @@ static void *bsd_alloc (unsigned char *options, int opt_len, int decomp)
* Allocate space for the dictionary. This may be more than one page in
* length.
*/
db->dict = (struct bsd_dict *) vmalloc (hsize *
sizeof (struct bsd_dict));
db->dict = vmalloc(hsize * sizeof(struct bsd_dict));
if (!db->dict)
{
bsd_free (db);
Expand All @@ -426,8 +425,7 @@ static void *bsd_alloc (unsigned char *options, int opt_len, int decomp)
*/
else
{
db->lens = (unsigned short *) vmalloc ((maxmaxcode + 1) *
sizeof (db->lens[0]));
db->lens = vmalloc((maxmaxcode + 1) * sizeof(db->lens[0]));
if (!db->lens)
{
bsd_free (db);
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/eql.c
Expand Up @@ -391,7 +391,7 @@ static int __eql_insert_slave(slave_queue_t *queue, slave_t *slave)
slave_t *duplicate_slave = NULL;

duplicate_slave = __eql_find_slave_dev(queue, slave->dev);
if (duplicate_slave != 0)
if (duplicate_slave)
eql_kill_one_slave(queue, duplicate_slave);

list_add(&slave->list, &queue->all_slaves);
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/irda/kingsun-sir.c
Expand Up @@ -509,12 +509,12 @@ static int kingsun_probe(struct usb_interface *intf,
spin_lock_init(&kingsun->lock);

/* Allocate input buffer */
kingsun->in_buf = (__u8 *)kmalloc(kingsun->max_rx, GFP_KERNEL);
kingsun->in_buf = kmalloc(kingsun->max_rx, GFP_KERNEL);
if (!kingsun->in_buf)
goto free_mem;

/* Allocate output buffer */
kingsun->out_buf = (__u8 *)kmalloc(KINGSUN_FIFO_SIZE, GFP_KERNEL);
kingsun->out_buf = kmalloc(KINGSUN_FIFO_SIZE, GFP_KERNEL);
if (!kingsun->out_buf)
goto free_mem;

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/slip.c
Expand Up @@ -957,7 +957,7 @@ slip_close(struct tty_struct *tty)
* STANDARD SLIP ENCAPSULATION *
************************************************************************/

int
static int
slip_esc(unsigned char *s, unsigned char *d, int len)
{
unsigned char *ptr = d;
Expand Down
1 change: 1 addition & 0 deletions include/linux/Kbuild
Expand Up @@ -7,6 +7,7 @@ header-y += raid/
header-y += spi/
header-y += sunrpc/
header-y += tc_act/
header-y += tc_ematch/
header-y += netfilter/
header-y += netfilter_arp/
header-y += netfilter_bridge/
Expand Down
4 changes: 2 additions & 2 deletions include/linux/if_pppol2tp.h
Expand Up @@ -32,8 +32,8 @@ struct pppol2tp_addr

struct sockaddr_in addr; /* IP address and port to send to */

__be16 s_tunnel, s_session; /* For matching incoming packets */
__be16 d_tunnel, d_session; /* For sending outgoing packets */
__u16 s_tunnel, s_session; /* For matching incoming packets */
__u16 d_tunnel, d_session; /* For sending outgoing packets */
};

/* Socket options:
Expand Down
12 changes: 11 additions & 1 deletion net/8021q/vlan_dev.c
Expand Up @@ -116,12 +116,22 @@ int vlan_skb_recv(struct sk_buff *skb, struct net_device *dev,
struct packet_type* ptype, struct net_device *orig_dev)
{
unsigned char *rawp = NULL;
struct vlan_hdr *vhdr = (struct vlan_hdr *)(skb->data);
struct vlan_hdr *vhdr;
unsigned short vid;
struct net_device_stats *stats;
unsigned short vlan_TCI;
__be16 proto;

if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL)
return -1;

if (unlikely(!pskb_may_pull(skb, VLAN_HLEN))) {
kfree_skb(skb);
return -1;
}

vhdr = (struct vlan_hdr *)(skb->data);

/* vlan_TCI = ntohs(get_unaligned(&vhdr->h_vlan_TCI)); */
vlan_TCI = ntohs(vhdr->h_vlan_TCI);

Expand Down
12 changes: 7 additions & 5 deletions net/bridge/br_netfilter.c
Expand Up @@ -509,17 +509,21 @@ static unsigned int br_nf_pre_routing(unsigned int hook, struct sk_buff **pskb,
int (*okfn)(struct sk_buff *))
{
struct iphdr *iph;
__u32 len;
struct sk_buff *skb = *pskb;
__u32 len = nf_bridge_encap_header_len(skb);

if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL)
return NF_STOLEN;

if (unlikely(!pskb_may_pull(skb, len)))
goto out;

if (skb->protocol == htons(ETH_P_IPV6) || IS_VLAN_IPV6(skb) ||
IS_PPPOE_IPV6(skb)) {
#ifdef CONFIG_SYSCTL
if (!brnf_call_ip6tables)
return NF_ACCEPT;
#endif
if ((skb = skb_share_check(*pskb, GFP_ATOMIC)) == NULL)
goto out;
nf_bridge_pull_encap_header_rcsum(skb);
return br_nf_pre_routing_ipv6(hook, skb, in, out, okfn);
}
Expand All @@ -532,8 +536,6 @@ static unsigned int br_nf_pre_routing(unsigned int hook, struct sk_buff **pskb,
!IS_PPPOE_IP(skb))
return NF_ACCEPT;

if ((skb = skb_share_check(*pskb, GFP_ATOMIC)) == NULL)
goto out;
nf_bridge_pull_encap_header_rcsum(skb);

if (!pskb_may_pull(skb, sizeof(struct iphdr)))
Expand Down
14 changes: 10 additions & 4 deletions net/core/dev_mcast.c
Expand Up @@ -116,11 +116,13 @@ int dev_mc_add(struct net_device *dev, void *addr, int alen, int glbl)
*/
int dev_mc_sync(struct net_device *to, struct net_device *from)
{
struct dev_addr_list *da;
struct dev_addr_list *da, *next;
int err = 0;

netif_tx_lock_bh(to);
for (da = from->mc_list; da != NULL; da = da->next) {
da = from->mc_list;
while (da != NULL) {
next = da->next;
if (!da->da_synced) {
err = __dev_addr_add(&to->mc_list, &to->mc_count,
da->da_addr, da->da_addrlen, 0);
Expand All @@ -134,6 +136,7 @@ int dev_mc_sync(struct net_device *to, struct net_device *from)
__dev_addr_delete(&from->mc_list, &from->mc_count,
da->da_addr, da->da_addrlen, 0);
}
da = next;
}
if (!err)
__dev_set_rx_mode(to);
Expand All @@ -156,19 +159,22 @@ EXPORT_SYMBOL(dev_mc_sync);
*/
void dev_mc_unsync(struct net_device *to, struct net_device *from)
{
struct dev_addr_list *da;
struct dev_addr_list *da, *next;

netif_tx_lock_bh(from);
netif_tx_lock_bh(to);

for (da = from->mc_list; da != NULL; da = da->next) {
da = from->mc_list;
while (da != NULL) {
next = da->next;
if (!da->da_synced)
continue;
__dev_addr_delete(&to->mc_list, &to->mc_count,
da->da_addr, da->da_addrlen, 0);
da->da_synced = 0;
__dev_addr_delete(&from->mc_list, &from->mc_count,
da->da_addr, da->da_addrlen, 0);
da = next;
}
__dev_set_rx_mode(to);

Expand Down
3 changes: 2 additions & 1 deletion net/core/neighbour.c
Expand Up @@ -33,6 +33,7 @@
#include <linux/rtnetlink.h>
#include <linux/random.h>
#include <linux/string.h>
#include <linux/log2.h>

#define NEIGH_DEBUG 1

Expand Down Expand Up @@ -311,7 +312,7 @@ static void neigh_hash_grow(struct neigh_table *tbl, unsigned long new_entries)

NEIGH_CACHE_STAT_INC(tbl, hash_grows);

BUG_ON(new_entries & (new_entries - 1));
BUG_ON(!is_power_of_2(new_entries));
new_hash = neigh_hash_alloc(new_entries);
if (!new_hash)
return;
Expand Down
2 changes: 1 addition & 1 deletion net/ipv4/ah4.c
Expand Up @@ -46,7 +46,7 @@ static int ip_clear_mutable_options(struct iphdr *iph, __be32 *daddr)
memcpy(daddr, optptr+optlen-4, 4);
/* Fall through */
default:
memset(optptr+2, 0, optlen-2);
memset(optptr, 0, optlen);
}
l -= optlen;
optptr += optlen;
Expand Down
4 changes: 4 additions & 0 deletions net/ipv4/ip_sockglue.c
Expand Up @@ -625,6 +625,10 @@ static int do_ip_setsockopt(struct sock *sk, int level,
{
struct ip_mreqn mreq;

err = -EPROTO;
if (inet_sk(sk)->is_icsk)
break;

if (optlen < sizeof(struct ip_mreq))
goto e_inval;
err = -EFAULT;
Expand Down
10 changes: 9 additions & 1 deletion net/ipv4/tcp_input.c
Expand Up @@ -755,7 +755,15 @@ void tcp_update_metrics(struct sock *sk)
}
}

/* Numbers are taken from RFC2414. */
/* Numbers are taken from RFC3390.
*
* John Heffner states:
*
* The RFC specifies a window of no more than 4380 bytes
* unless 2*MSS > 4380. Reading the pseudocode in the RFC
* is a bit misleading because they use a clamp at 4380 bytes
* rather than use a multiplier in the relevant range.
*/
__u32 tcp_init_cwnd(struct tcp_sock *tp, struct dst_entry *dst)
{
__u32 cwnd = (dst ? dst_metric(dst, RTAX_INITCWND) : 0);
Expand Down
4 changes: 4 additions & 0 deletions net/ipv6/ipv6_sockglue.c
Expand Up @@ -554,6 +554,10 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname,
{
struct ipv6_mreq mreq;

retv = -EPROTO;
if (inet_sk(sk)->is_icsk)
break;

retv = -EFAULT;
if (copy_from_user(&mreq, optval, sizeof(struct ipv6_mreq)))
break;
Expand Down

0 comments on commit 28d9aa6

Please sign in to comment.