Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3ee783a3 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6:
  [DECNET]: Endianess fixes (try #2)
  [TG3]: Fix array overrun in tg3_read_partno().
  [NET]: Set truesize in pskb_copy
  [NETPOLL]: Compute checksum properly in netpoll_send_udp().
  [PKT_SCHED] sch_htb: Use hlist_del_init().
  [TCP]: Don't use highmem in tcp hash size calculation.
  [NET]: kconfig, correct traffic shaper
parents 80c21881 375d9d71
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -2833,7 +2833,7 @@ config NET_FC
	  "SCSI generic support".

config SHAPER
	tristate "Traffic Shaper (EXPERIMENTAL)"
	tristate "Traffic Shaper (OBSOLETE)"
	depends on EXPERIMENTAL
	---help---
	  The traffic shaper is a virtual network device that allows you to
@@ -2842,9 +2842,9 @@ config SHAPER
	  these virtual devices. See
	  <file:Documentation/networking/shaper.txt> for more information.

	  An alternative to this traffic shaper is the experimental
	  Class-Based Queuing (CBQ) scheduling support which you get if you
	  say Y to "QoS and/or fair queuing" above.
	  An alternative to this traffic shaper are traffic schedulers which
	  you'll get if you say Y to "QoS and/or fair queuing" in
	  "Networking options".

	  To compile this driver as a module, choose M here: the module
	  will be called shaper.  If unsure, say N.
+12 −7
Original line number Diff line number Diff line
@@ -10212,7 +10212,7 @@ skip_phy_reset:
static void __devinit tg3_read_partno(struct tg3 *tp)
{
	unsigned char vpd_data[256];
	int i;
	unsigned int i;
	u32 magic;

	if (tg3_nvram_read_swab(tp, 0x0, &magic))
@@ -10258,9 +10258,9 @@ static void __devinit tg3_read_partno(struct tg3 *tp)
	}

	/* Now parse and find the part number. */
	for (i = 0; i < 256; ) {
	for (i = 0; i < 254; ) {
		unsigned char val = vpd_data[i];
		int block_end;
		unsigned int block_end;

		if (val == 0x82 || val == 0x91) {
			i = (i + 3 +
@@ -10276,21 +10276,26 @@ static void __devinit tg3_read_partno(struct tg3 *tp)
			     (vpd_data[i + 1] +
			      (vpd_data[i + 2] << 8)));
		i += 3;
		while (i < block_end) {

		if (block_end > 256)
			goto out_not_found;

		while (i < (block_end - 2)) {
			if (vpd_data[i + 0] == 'P' &&
			    vpd_data[i + 1] == 'N') {
				int partno_len = vpd_data[i + 2];

				if (partno_len > 24)
				i += 3;
				if (partno_len > 24 || (partno_len + i) > 256)
					goto out_not_found;

				memcpy(tp->board_part_number,
				       &vpd_data[i + 3],
				       partno_len);
				       &vpd_data[i], partno_len);

				/* Success. */
				return;
			}
			i += 3 + vpd_data[i + 2];
		}

		/* Part number not found. */
+6 −0
Original line number Diff line number Diff line
@@ -340,6 +340,12 @@ void netpoll_send_udp(struct netpoll *np, const char *msg, int len)
	udph->dest = htons(np->remote_port);
	udph->len = htons(udp_len);
	udph->check = 0;
	udph->check = csum_tcpudp_magic(htonl(np->local_ip),
					htonl(np->remote_ip),
					udp_len, IPPROTO_UDP,
					csum_partial((unsigned char *)udph, udp_len, 0));
	if (udph->check == 0)
		udph->check = -1;

	skb->nh.iph = iph = (struct iphdr *)skb_push(skb, sizeof(*iph));

+1 −0
Original line number Diff line number Diff line
@@ -639,6 +639,7 @@ struct sk_buff *pskb_copy(struct sk_buff *skb, gfp_t gfp_mask)
	n->csum	     = skb->csum;
	n->ip_summed = skb->ip_summed;

	n->truesize += skb->data_len;
	n->data_len  = skb->data_len;
	n->len	     = skb->len;

+13 −12
Original line number Diff line number Diff line
@@ -166,7 +166,7 @@ static struct hlist_head *dn_find_list(struct sock *sk)
	if (scp->addr.sdn_flags & SDF_WILD)
		return hlist_empty(&dn_wild_sk) ? &dn_wild_sk : NULL;

	return &dn_sk_hash[scp->addrloc & DN_SK_HASH_MASK];
	return &dn_sk_hash[dn_ntohs(scp->addrloc) & DN_SK_HASH_MASK];
}

/* 
@@ -180,7 +180,7 @@ static int check_port(__le16 port)
	if (port == 0)
		return -1;

	sk_for_each(sk, node, &dn_sk_hash[port & DN_SK_HASH_MASK]) {
	sk_for_each(sk, node, &dn_sk_hash[dn_ntohs(port) & DN_SK_HASH_MASK]) {
		struct dn_scp *scp = DN_SK(sk);
		if (scp->addrloc == port)
			return -1;
@@ -194,12 +194,12 @@ static unsigned short port_alloc(struct sock *sk)
static unsigned short port = 0x2000;
	unsigned short i_port = port;

	while(check_port(++port) != 0) {
	while(check_port(dn_htons(++port)) != 0) {
		if (port == i_port)
			return 0;
	}

	scp->addrloc = port;
	scp->addrloc = dn_htons(port);

	return 1;
}
@@ -418,7 +418,7 @@ struct sock *dn_find_by_skb(struct sk_buff *skb)
	struct dn_scp *scp;

	read_lock(&dn_hash_lock);
	sk_for_each(sk, node, &dn_sk_hash[cb->dst_port & DN_SK_HASH_MASK]) {
	sk_for_each(sk, node, &dn_sk_hash[dn_ntohs(cb->dst_port) & DN_SK_HASH_MASK]) {
		scp = DN_SK(sk);
		if (cb->src != dn_saddr2dn(&scp->peer))
			continue;
@@ -1017,12 +1017,13 @@ static void dn_access_copy(struct sk_buff *skb, struct accessdata_dn *acc)
static void dn_user_copy(struct sk_buff *skb, struct optdata_dn *opt)
{
	unsigned char *ptr = skb->data;
	u16 len = *ptr++; /* yes, it's 8bit on the wire */

        opt->opt_optl   = *ptr++;
	BUG_ON(len > 16); /* we've checked the contents earlier */
	opt->opt_optl   = dn_htons(len);
	opt->opt_status = 0;
        memcpy(opt->opt_data, ptr, opt->opt_optl);
        skb_pull(skb, dn_ntohs(opt->opt_optl) + 1);

	memcpy(opt->opt_data, ptr, len);
	skb_pull(skb, len + 1);
}

static struct sk_buff *dn_wait_for_connect(struct sock *sk, long *timeo)
Loading