Netdev List
 help / color / mirror / Atom feed
* [net-2.6 PATCH] ixgbe: fix possible NULL pointer deference in shutdown path
From: Jeff Kirsher @ 2010-12-02  6:54 UTC (permalink / raw)
  To: davem; +Cc: netdev, gospo, bphilips, Don Skidmore, Jeff Kirsher

From: Don Skidmore <donald.c.skidmore@intel.com>

After freeing the rings we were not zeroing out the ring count values.
This patch now clears these counts correctly.

Reported-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Tested-by: Stephen Ko <stephen.s.ko@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---

 0 files changed, 0 insertions(+), 0 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index fbad4d8..eee0b29 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -4771,6 +4771,9 @@ void ixgbe_clear_interrupt_scheme(struct ixgbe_adapter *adapter)
 		adapter->rx_ring[i] = NULL;
 	}
 
+	adapter->num_tx_queues = 0;
+	adapter->num_rx_queues = 0;
+
 	ixgbe_free_q_vectors(adapter);
 	ixgbe_reset_interrupt_capability(adapter);
 }


^ permalink raw reply related

* Re: [RFC] [PATCH 02/11] crypto: Use scatterwalk_crypto_chain
From: Herbert Xu @ 2010-12-02  6:48 UTC (permalink / raw)
  To: Steffen Klassert
  Cc: David Miller, Andreas Gruenbacher, Alex Badea, netdev,
	linux-crypto
In-Reply-To: <20101122102654.GE1868@secunet.com>

On Mon, Nov 22, 2010 at 11:26:54AM +0100, Steffen Klassert wrote:
> Use scatterwalk_crypto_chain in favor of locally defined chaining functions.
> 
> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>

I've applied patches 1&2 since they're logically separate from the
rest of the series and make sense on their own.

Thanks,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply

* Re: [PATCH net-next-2.6] filter: add a security check at install time
From: Eric Dumazet @ 2010-12-02  6:46 UTC (permalink / raw)
  To: Changli Gao; +Cc: David Miller, hagen, wirelesser, netdev, Dan Rosenberg
In-Reply-To: <AANLkTikK=dy6U0QBjkJxZXeqYXVHwZqjmRhnmYBH-22r@mail.gmail.com>

Le jeudi 02 décembre 2010 à 10:30 +0800, Changli Gao a écrit :

> It seems wrong. Think about the following instructions:
> 
> /* m[1] isn't set */
>    jeq jt jf
> jt:
>    st m[1]
>    jmp ja
> jf:
>    jmp ja2 /* m[1] is invalidated by masks */
> ja:
>    ld m[1] /* -EINVAL is returned */
> ja2:
> 
> So you need to search all the possible branches to validate the instructions.

Well, I already did this branch search.

Its only that the instruction following a JMP should not inherit
memvalid from the JMP itself, but the AND of memvalid of all possible
jumps that can arrive to this instruction.

I'll think about it after some coffee, but I feel I might just set
memvalid to ~0 after the JMPS

Thanks

[PATCH v2 net-next-2.6] filter: add a security check at install time

We added some security checks in commit 57fe93b374a6
(filter: make sure filters dont read uninitialized memory) to close a
potential leak of kernel information to user.

This added a potential extra cost at run time, while we can perform a
check of the filter itself, to make sure a malicious user doesnt try to
abuse us.

This patch adds a check_loads() function, whole unique purpose is to
make this check, allocating a temporary array of mask. We scan the
filter and propagate a bitmask information, telling us if a load M(K) is
allowed because a previous store M(K) is guaranteed. (So that
sk_run_filter() can possibly not read unitialized memory)

Note: this can uncover application bug, denying a filter attach,
previously allowed.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Dan Rosenberg <drosenberg@vsecurity.com>
Cc: Changli Gao <xiaosuo@gmail.com>
---
v2: set memvalid to ~0 on JMP instructions

diff --git a/net/core/filter.c b/net/core/filter.c
index a44d27f..0d636ef 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -166,11 +166,9 @@ unsigned int sk_run_filter(struct sk_buff *skb, const struct sock_filter *fentry
 	u32 A = 0;			/* Accumulator */
 	u32 X = 0;			/* Index Register */
 	u32 mem[BPF_MEMWORDS];		/* Scratch Memory Store */
-	unsigned long memvalid = 0;
 	u32 tmp;
 	int k;
 
-	BUILD_BUG_ON(BPF_MEMWORDS > BITS_PER_LONG);
 	/*
 	 * Process array of filter instructions.
 	 */
@@ -318,12 +316,10 @@ load_b:
 			X = K;
 			continue;
 		case BPF_S_LD_MEM:
-			A = (memvalid & (1UL << K)) ?
-				mem[K] : 0;
+			A = mem[K];
 			continue;
 		case BPF_S_LDX_MEM:
-			X = (memvalid & (1UL << K)) ?
-				mem[K] : 0;
+			X = mem[K];
 			continue;
 		case BPF_S_MISC_TAX:
 			X = A;
@@ -336,11 +332,9 @@ load_b:
 		case BPF_S_RET_A:
 			return A;
 		case BPF_S_ST:
-			memvalid |= 1UL << K;
 			mem[K] = A;
 			continue;
 		case BPF_S_STX:
-			memvalid |= 1UL << K;
 			mem[K] = X;
 			continue;
 		default:
@@ -419,6 +413,66 @@ load_b:
 }
 EXPORT_SYMBOL(sk_run_filter);
 
+/*
+ * Security :
+ * A BPF program is able to use 16 cells of memory to store intermediate
+ * values (check u32 mem[BPF_MEMWORDS] in sk_run_filter())
+ * As we dont want to clear mem[] array for each packet going through
+ * sk_run_filter(), we check that filter loaded by user never try to read
+ * a cell if not previously written, and we check all branches to be sure
+ * a malicious user doesnt try to abuse us.
+ */
+static int check_load_and_stores(struct sock_filter *filter, int flen)
+{
+	u16 *masks, memvalid = 0; /* one bit per cell, 16 cells */
+	int pc, ret = 0;
+
+	BUILD_BUG_ON(BPF_MEMWORDS > 16);
+	masks = kmalloc(flen * sizeof(*masks), GFP_KERNEL);
+	if (!masks)
+		return -ENOMEM;
+	memset(masks, 0xff, flen * sizeof(*masks));
+
+	for (pc = 0; pc < flen; pc++) {
+		memvalid &= masks[pc];
+
+		switch (filter[pc].code) {
+		case BPF_S_ST:
+		case BPF_S_STX:
+			memvalid |= (1 << filter[pc].k);
+			break;
+		case BPF_S_LD_MEM:
+		case BPF_S_LDX_MEM:
+			if (!(memvalid & (1 << filter[pc].k))) {
+				ret = -EINVAL;
+				goto error;
+			}
+			break;
+		case BPF_S_JMP_JA:
+			/* a jump must set masks on target */
+			masks[pc + 1 + filter[pc].k] &= memvalid;
+			memvalid = ~0;
+			break;
+		case BPF_S_JMP_JEQ_K:
+		case BPF_S_JMP_JEQ_X:
+		case BPF_S_JMP_JGE_K:
+		case BPF_S_JMP_JGE_X:
+		case BPF_S_JMP_JGT_K:
+		case BPF_S_JMP_JGT_X:
+		case BPF_S_JMP_JSET_X:
+		case BPF_S_JMP_JSET_K:
+			/* a jump must set masks on targets */
+			masks[pc + 1 + filter[pc].jt] &= memvalid;
+			masks[pc + 1 + filter[pc].jf] &= memvalid;
+			memvalid = ~0;
+			break;
+		}
+	}
+error:
+	kfree(masks);
+	return ret;
+}
+
 /**
  *	sk_chk_filter - verify socket filter code
  *	@filter: filter to verify
@@ -547,7 +601,7 @@ int sk_chk_filter(struct sock_filter *filter, int flen)
 	switch (filter[flen - 1].code) {
 	case BPF_S_RET_K:
 	case BPF_S_RET_A:
-		return 0;
+		return check_load_and_stores(filter, flen);
 	}
 	return -EINVAL;
 }






^ permalink raw reply related

* Re: Bonding, GRO and tcp_reordering
From: Simon Horman @ 2010-12-02  6:39 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: Ben Hutchings, netdev
In-Reply-To: <1291178826.2856.434.camel@edumazet-laptop>

On Wed, Dec 01, 2010 at 05:47:06AM +0100, Eric Dumazet wrote:
> Le mercredi 01 décembre 2010 à 13:34 +0900, Simon Horman a écrit :
> 
> > I was tweaking those values recently for some latency tuning
> > but I didn't think of them in relation to last night's tests.
> > 
> > In terms of my measurements, its just benchmarking at this stage.
> > So a trade-off between throughput and latency is acceptable, so long
> > as I remember to measure what it is.
> > 
> 
> I was thinking again this morning about GRO and bonding, and dont know
> if it actually works...
> 
> Is GRO on on individual eth0/eth1/eth2 you use, or on bonding device
> itself ?

All of the above. I can check different combinations if it helps.


^ permalink raw reply

* [PATCH] net: arp: use assignment
From: Changli Gao @ 2010-12-02  6:07 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Changli Gao

Only when dont_send is 0, arp_filter() is consulted, so we can simply
assign the return value of arp_filter() to dont_send instead.

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
---
 net/ipv4/arp.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index 7833f17..10af759 100644
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -883,7 +883,7 @@ static int arp_process(struct sk_buff *skb)
 
 			dont_send = arp_ignore(in_dev, sip, tip);
 			if (!dont_send && IN_DEV_ARPFILTER(in_dev))
-				dont_send |= arp_filter(sip, tip, dev);
+				dont_send = arp_filter(sip, tip, dev);
 			if (!dont_send) {
 				n = neigh_event_ns(&arp_tbl, sha, &sip, dev);
 				if (n) {

^ permalink raw reply related

* Re: [PATCH 2/2] ath: Fix logging message typos
From: Nick Kossifidis @ 2010-12-02  6:01 UTC (permalink / raw)
  To: Joe Perches
  Cc: linux-wireless, Jiri Slaby, netdev, ath5k-devel, Bob Copeland,
	John W. Linville, Jouni Malinen, Senthil Balasubramanian,
	ath9k-devel, Vasanthakumar Thiagarajan, Peter Stuge, linux-kernel
In-Reply-To: <1291268087.1761.3.camel@Joe-Laptop>

2010/12/2 Joe Perches <joe@perches.com>:
> On Thu, 2010-12-02 at 06:30 +0100, Peter Stuge wrote:
>> Joe Perches wrote:
>> > +++ b/drivers/net/wireless/ath/ath9k/ar9002_calib.c
>> ..
>> > @@ -734,7 +734,7 @@ static bool ar9285_hw_cl_cal(struct ath_hw *ah, struct ath9k_channel *chan)
>> >     if (!ath9k_hw_wait(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_CAL,
>> >                       0, AH_WAIT_TIMEOUT)) {
>> >             ath_dbg(common, ATH_DBG_CALIBRATE,
>> > -                   "offset calibration failed to complete in 1ms; noisy ??\n");
>> > +                   "offset calibration failed to complete in 1ms; noisy enfironment?\n");
>>
>> enfironment? :)
>
> Umm, what's a typo fix patch without more typos?
> Correct?  How dull...
>
>> >     ath_dbg(common, ATH_DBG_ANI,
>> > -           "Getting spur idx %d is2Ghz. %d val %x\n",
>> > +           "Getting spur idx:%d is2Ghz:%d val:%x\n",
>> >             i, is2GHz, ah->config.spurchans[i][is2GHz]);
>>
>> Is this short for "spurious" ?
>
> Likely.  Anyone want to change it to a whole word?
>
>

Nope it stands for spur noise (harmonics)
http://www.patentgenius.com/patent/7835456.html

(I have to add that link to the comments, it's new ;-))

-- 
GPG ID: 0xD21DB2DB
As you read this post global entropy rises. Have Fun ;-)
Nick
_______________________________________________
ath9k-devel mailing list
ath9k-devel@lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel

^ permalink raw reply

* Re: jme: UDP checksum error, and lots of them
From: David Miller @ 2010-12-02  5:59 UTC (permalink / raw)
  To: cooldavid; +Cc: jengelh, netdev
In-Reply-To: <20101202042820.M98672@cooldavid.org>

From: "Guo-Fu Tseng" <cooldavid@cooldavid.org>
Date: Thu, 2 Dec 2010 12:33:01 +0800

> I suspect that there might be some the HW-Checksum behavior error.
> ex: Replaced the UDP checksum field while it's all zero(no need to checksum)

I checked the VPNC code and it receives UDP encapsulated traffic using
a normal UDP socket.  So any bad checksums should show up in the
statistics and in fact the packets should be dropped by the IPv4
stack before making it to the vpnc application.

Something isn't right here.  The only thing that makes sense is if
the tcpdump checksum validation is wrong for some reason.  Because
only then could we give a reason for the UDP frames to not be
dropped before vpnc can see them.


^ permalink raw reply

* [PATCH 2/2 V2] ath: Fix logging message typos
From: Joe Perches @ 2010-12-02  5:35 UTC (permalink / raw)
  To: Jiri Slaby, Nick Kossifidis, Luis R. Rodriguez, Bob Copeland,
	Jouni Malinen
  Cc: John W. Linville, linux-wireless, ath5k-devel, netdev,
	linux-kernel, ath9k-devel
In-Reply-To: <276469c602c402565b49f99521ea19757429e81e.1291266731.git.joe@perches.com>

Fix immunity misspelling.
Standardize strings from multiple modules.
Add spaces between words of concatenated strings.

Signed-off-by: Joe Perches <joe@perches.com>
---

V2: Fix a newly introduced tyop...

 drivers/net/wireless/ath/ath5k/ani.c          |    2 +-
 drivers/net/wireless/ath/ath9k/ar9002_calib.c |    4 ++--
 drivers/net/wireless/ath/ath9k/eeprom_4k.c    |    4 ++--
 drivers/net/wireless/ath/ath9k/eeprom_9287.c  |    2 +-
 drivers/net/wireless/ath/ath9k/eeprom_def.c   |    2 +-
 drivers/net/wireless/ath/ath9k/htc_hst.c      |    6 +++---
 6 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/net/wireless/ath/ath5k/ani.c b/drivers/net/wireless/ath/ath5k/ani.c
index 6b75b22..9c41881 100644
--- a/drivers/net/wireless/ath/ath5k/ani.c
+++ b/drivers/net/wireless/ath/ath5k/ani.c
@@ -74,7 +74,7 @@ ath5k_ani_set_noise_immunity_level(struct ath5k_hw *ah, int level)
 	static const s8 fr[] = { -78, -80 };
 #endif
 	if (level < 0 || level >= ARRAY_SIZE(sz)) {
-		ATH5K_ERR(ah->ah_sc, "noise immuniy level %d out of range",
+		ATH5K_ERR(ah->ah_sc, "noise immunity level %d out of range",
 			  level);
 		return;
 	}
diff --git a/drivers/net/wireless/ath/ath9k/ar9002_calib.c b/drivers/net/wireless/ath/ath9k/ar9002_calib.c
index a7705e7..199131e 100644
--- a/drivers/net/wireless/ath/ath9k/ar9002_calib.c
+++ b/drivers/net/wireless/ath/ath9k/ar9002_calib.c
@@ -720,7 +720,7 @@ static bool ar9285_hw_cl_cal(struct ath_hw *ah, struct ath9k_channel *chan)
 		if (!ath9k_hw_wait(ah, AR_PHY_AGC_CONTROL,
 				  AR_PHY_AGC_CONTROL_CAL, 0, AH_WAIT_TIMEOUT)) {
 			ath_dbg(common, ATH_DBG_CALIBRATE,
-				"offset calibration failed to complete in 1ms; noisy ??\n");
+				"offset calibration failed to complete in 1ms; noisy environment?\n");
 			return false;
 		}
 		REG_CLR_BIT(ah, AR_PHY_TURBO, AR_PHY_FC_DYN2040_EN);
@@ -734,7 +734,7 @@ static bool ar9285_hw_cl_cal(struct ath_hw *ah, struct ath9k_channel *chan)
 	if (!ath9k_hw_wait(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_CAL,
 			  0, AH_WAIT_TIMEOUT)) {
 		ath_dbg(common, ATH_DBG_CALIBRATE,
-			"offset calibration failed to complete in 1ms; noisy ??\n");
+			"offset calibration failed to complete in 1ms; noisy environment?\n");
 		return false;
 	}
 
diff --git a/drivers/net/wireless/ath/ath9k/eeprom_4k.c b/drivers/net/wireless/ath/ath9k/eeprom_4k.c
index 35b1a8c..939fc7a 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom_4k.c
+++ b/drivers/net/wireless/ath/ath9k/eeprom_4k.c
@@ -90,7 +90,7 @@ static int ath9k_hw_4k_check_eeprom(struct ath_hw *ah)
 				}
 			} else {
 				ath_err(common,
-					"Invalid EEPROM Magic. endianness mismatch.\n");
+					"Invalid EEPROM Magic. Endianness mismatch.\n");
 				return -EINVAL;
 			}
 		}
@@ -1178,7 +1178,7 @@ static u16 ath9k_hw_4k_get_spur_channel(struct ath_hw *ah, u16 i, bool is2GHz)
 	u16 spur_val = AR_NO_SPUR;
 
 	ath_dbg(common, ATH_DBG_ANI,
-		"Getting spur idx %d is2Ghz. %d val %x\n",
+		"Getting spur idx:%d is2Ghz:%d val:%x\n",
 		i, is2GHz, ah->config.spurchans[i][is2GHz]);
 
 	switch (ah->config.spurmode) {
diff --git a/drivers/net/wireless/ath/ath9k/eeprom_9287.c b/drivers/net/wireless/ath/ath9k/eeprom_9287.c
index 0be5351..9ec4bc8 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom_9287.c
+++ b/drivers/net/wireless/ath/ath9k/eeprom_9287.c
@@ -1150,7 +1150,7 @@ static u16 ath9k_hw_ar9287_get_spur_channel(struct ath_hw *ah,
 	u16 spur_val = AR_NO_SPUR;
 
 	ath_dbg(common, ATH_DBG_ANI,
-		"Getting spur idx %d is2Ghz. %d val %x\n",
+		"Getting spur idx:%d is2Ghz:%d val:%x\n",
 		i, is2GHz, ah->config.spurchans[i][is2GHz]);
 
 	switch (ah->config.spurmode) {
diff --git a/drivers/net/wireless/ath/ath9k/eeprom_def.c b/drivers/net/wireless/ath/ath9k/eeprom_def.c
index 91722fb..9aa31aa 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom_def.c
+++ b/drivers/net/wireless/ath/ath9k/eeprom_def.c
@@ -1458,7 +1458,7 @@ static u16 ath9k_hw_def_get_spur_channel(struct ath_hw *ah, u16 i, bool is2GHz)
 	u16 spur_val = AR_NO_SPUR;
 
 	ath_dbg(common, ATH_DBG_ANI,
-		"Getting spur idx %d is2Ghz. %d val %x\n",
+		"Getting spur idx:%d is2Ghz:%d val:%x\n",
 		i, is2GHz, ah->config.spurchans[i][is2GHz]);
 
 	switch (ah->config.spurmode) {
diff --git a/drivers/net/wireless/ath/ath9k/htc_hst.c b/drivers/net/wireless/ath/ath9k/htc_hst.c
index c41ab8c..69b6aca 100644
--- a/drivers/net/wireless/ath/ath9k/htc_hst.c
+++ b/drivers/net/wireless/ath/ath9k/htc_hst.c
@@ -239,7 +239,7 @@ int htc_connect_service(struct htc_target *target,
 	/* Find an available endpoint */
 	endpoint = get_next_avail_ep(target->endpoint);
 	if (!endpoint) {
-		dev_err(target->dev, "Endpoint is not available for"
+		dev_err(target->dev, "Endpoint is not available for "
 			"service %d\n", service_connreq->service_id);
 		return -EINVAL;
 	}
@@ -253,7 +253,7 @@ int htc_connect_service(struct htc_target *target,
 	skb = alloc_skb(sizeof(struct htc_conn_svc_msg) +
 			    sizeof(struct htc_frame_hdr), GFP_ATOMIC);
 	if (!skb) {
-		dev_err(target->dev, "Failed to allocate buf to send"
+		dev_err(target->dev, "Failed to allocate buf to send "
 			"service connect req\n");
 		return -ENOMEM;
 	}
@@ -434,7 +434,7 @@ struct htc_target *ath9k_htc_hw_alloc(void *hif_handle,
 
 	target = kzalloc(sizeof(struct htc_target), GFP_KERNEL);
 	if (!target) {
-		printk(KERN_ERR "Unable to allocate memory for"
+		printk(KERN_ERR "Unable to allocate memory for "
 			"target device\n");
 		return NULL;
 	}
-- 
1.7.3.2.245.g03276.dirty

^ permalink raw reply related

* Re: [ath9k-devel] [PATCH 2/2] ath: Fix logging message typos
From: Joe Perches @ 2010-12-02  5:34 UTC (permalink / raw)
  To: Peter Stuge
  Cc: Jiri Slaby, Nick Kossifidis, Luis R. Rodriguez, Bob Copeland,
	Jouni Malinen, Vasanthakumar Thiagarajan, Senthil Balasubramanian,
	netdev-u79uwXL29TY76Z2rM5mHXA, ath5k-devel-xDcbHBWguxEUs3QNXV6qNA,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA, John W. Linville,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	ath9k-devel-xDcbHBWguxHbcTqmT+pZeQ
In-Reply-To: <20101202053055.19479.qmail-Y+HMSxxDrH8@public.gmane.org>

On Thu, 2010-12-02 at 06:30 +0100, Peter Stuge wrote:
> Joe Perches wrote:
> > +++ b/drivers/net/wireless/ath/ath9k/ar9002_calib.c
> ..
> > @@ -734,7 +734,7 @@ static bool ar9285_hw_cl_cal(struct ath_hw *ah, struct ath9k_channel *chan)
> >  	if (!ath9k_hw_wait(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_CAL,
> >  			  0, AH_WAIT_TIMEOUT)) {
> >  		ath_dbg(common, ATH_DBG_CALIBRATE,
> > -			"offset calibration failed to complete in 1ms; noisy ??\n");
> > +			"offset calibration failed to complete in 1ms; noisy enfironment?\n");
> 
> enfironment? :)

Umm, what's a typo fix patch without more typos?
Correct?  How dull...

> >  	ath_dbg(common, ATH_DBG_ANI,
> > -		"Getting spur idx %d is2Ghz. %d val %x\n",
> > +		"Getting spur idx:%d is2Ghz:%d val:%x\n",
> >  		i, is2GHz, ah->config.spurchans[i][is2GHz]);
> 
> Is this short for "spurious" ?

Likely.  Anyone want to change it to a whole word?

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH 2/2] ath: Fix logging message typos
From: Peter Stuge @ 2010-12-02  5:30 UTC (permalink / raw)
  To: Joe Perches
  Cc: linux-wireless, Jiri Slaby, netdev, ath5k-devel, Bob Copeland,
	John W. Linville, Jouni Malinen, Senthil Balasubramanian,
	ath9k-devel, Nick Kossifidis, Vasanthakumar Thiagarajan,
	linux-kernel
In-Reply-To: <a345e995a816576a4c2c39aec43716c18011475b.1291266731.git.joe@perches.com>

Joe Perches wrote:
> +++ b/drivers/net/wireless/ath/ath9k/ar9002_calib.c
..
> @@ -734,7 +734,7 @@ static bool ar9285_hw_cl_cal(struct ath_hw *ah, struct ath9k_channel *chan)
>  	if (!ath9k_hw_wait(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_CAL,
>  			  0, AH_WAIT_TIMEOUT)) {
>  		ath_dbg(common, ATH_DBG_CALIBRATE,
> -			"offset calibration failed to complete in 1ms; noisy ??\n");
> +			"offset calibration failed to complete in 1ms; noisy enfironment?\n");

enfironment? :)


> +++ b/drivers/net/wireless/ath/ath9k/eeprom_4k.c
..
> @@ -1178,7 +1178,7 @@ static u16 ath9k_hw_4k_get_spur_channel(struct ath_hw *ah, u16 i, bool is2GHz)
>  	u16 spur_val = AR_NO_SPUR;
>  
>  	ath_dbg(common, ATH_DBG_ANI,
> -		"Getting spur idx %d is2Ghz. %d val %x\n",
> +		"Getting spur idx:%d is2Ghz:%d val:%x\n",
>  		i, is2GHz, ah->config.spurchans[i][is2GHz]);

Is this short for "spurious" ?


//Peter

^ permalink raw reply

* [PATCH 1/2] ath: Fix ath_dbg uses missing newlines and access beyond array bound
From: Joe Perches @ 2010-12-02  5:13 UTC (permalink / raw)
  To: Luis R. Rodriguez, Jouni Malinen, Vasanthakumar Thiagarajan,
	Senthil Balasubramanian
  Cc: John W. Linville, linux-wireless, ath9k-devel, netdev,
	linux-kernel

Add missing newlines to ath_dbg uses
ar9300RateSize is not a power of 4, fix to print array line by line.

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/wireless/ath/ath9k/ar9003_eeprom.c |   29 ++---------------------
 drivers/net/wireless/ath/ath9k/calib.c         |    4 +-
 drivers/net/wireless/ath/ath9k/gpio.c          |    6 ++--
 drivers/net/wireless/ath/ath9k/htc_drv_gpio.c  |    7 ++---
 drivers/net/wireless/ath/ath9k/htc_drv_main.c  |    2 +-
 5 files changed, 12 insertions(+), 36 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
index e6ae62b..beb3e87 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
@@ -3342,7 +3342,7 @@ static int ar9300_eeprom_restore_internal(struct ath_hw *ah,
 	goto fail;
 
 found:
-	ath_dbg(common, ATH_DBG_EEPROM, "Found valid EEPROM data");
+	ath_dbg(common, ATH_DBG_EEPROM, "Found valid EEPROM data\n");
 
 	for (it = 0; it < MSTATE; it++) {
 		if (!read(ah, cptr, word, COMP_HDR_LEN))
@@ -4084,22 +4084,9 @@ static void ar9003_hw_set_target_power_eeprom(struct ath_hw *ah, u16 freq,
 	    ar9003_hw_eeprom_get_ht40_tgt_pwr(ah, HT_TARGET_RATE_23, freq,
 					      is2GHz) + ht40PowerIncForPdadc;
 
-	while (i < ar9300RateSize) {
-		ath_dbg(common, ATH_DBG_EEPROM,
-			"TPC[%02d] 0x%08x ", i, targetPowerValT2[i]);
-		i++;
-
-		ath_dbg(common, ATH_DBG_EEPROM,
-			"TPC[%02d] 0x%08x ", i, targetPowerValT2[i]);
-		i++;
-
-		ath_dbg(common, ATH_DBG_EEPROM,
-			"TPC[%02d] 0x%08x ", i, targetPowerValT2[i]);
-		i++;
-
+	for (i = 0; i < ar9300RateSize; i++) {
 		ath_dbg(common, ATH_DBG_EEPROM,
 			"TPC[%02d] 0x%08x\n", i, targetPowerValT2[i]);
-		i++;
 	}
 }
 
@@ -4687,17 +4674,7 @@ static void ath9k_hw_ar9300_set_txpower(struct ath_hw *ah,
 
 	for (i = 0; i < ar9300RateSize; i++) {
 		ath_dbg(common, ATH_DBG_EEPROM,
-			"TPC[%02d] 0x%08x ", i, targetPowerValT2[i]);
-		i++;
-		ath_dbg(common, ATH_DBG_EEPROM,
-			"TPC[%02d] 0x%08x ", i, targetPowerValT2[i]);
-		i++;
-		ath_dbg(common, ATH_DBG_EEPROM,
-			"TPC[%02d] 0x%08x ", i, targetPowerValT2[i]);
-		i++;
-		ath_dbg(common, ATH_DBG_EEPROM,
-			"TPC[%02d] 0x%08x\n\n", i, targetPowerValT2[i]);
-		i++;
+			"TPC[%02d] 0x%08x\n", i, targetPowerValT2[i]);
 	}
 
 	/*
diff --git a/drivers/net/wireless/ath/ath9k/calib.c b/drivers/net/wireless/ath/ath9k/calib.c
index 0b6c623..b68a1ac 100644
--- a/drivers/net/wireless/ath/ath9k/calib.c
+++ b/drivers/net/wireless/ath/ath9k/calib.c
@@ -324,12 +324,12 @@ static void ath9k_hw_nf_sanitize(struct ath_hw *ah, s16 *nf)
 
 		if (nf[i] > ATH9K_NF_TOO_HIGH) {
 			ath_dbg(common, ATH_DBG_CALIBRATE,
-				"NF[%d] (%d) > MAX (%d), correcting to MAX",
+				"NF[%d] (%d) > MAX (%d), correcting to MAX\n",
 				i, nf[i], ATH9K_NF_TOO_HIGH);
 			nf[i] = limit->max;
 		} else if (nf[i] < limit->min) {
 			ath_dbg(common, ATH_DBG_CALIBRATE,
-				"NF[%d] (%d) < MIN (%d), correcting to NOM",
+				"NF[%d] (%d) < MIN (%d), correcting to NOM\n",
 				i, nf[i], limit->min);
 			nf[i] = limit->nominal;
 		}
diff --git a/drivers/net/wireless/ath/ath9k/gpio.c b/drivers/net/wireless/ath/ath9k/gpio.c
index 60b2fb7..1337640 100644
--- a/drivers/net/wireless/ath/ath9k/gpio.c
+++ b/drivers/net/wireless/ath/ath9k/gpio.c
@@ -237,12 +237,12 @@ static void ath_detect_bt_priority(struct ath_softc *sc)
 		/* Detect if colocated bt started scanning */
 		if (btcoex->bt_priority_cnt >= ATH_BT_CNT_SCAN_THRESHOLD) {
 			ath_dbg(ath9k_hw_common(sc->sc_ah), ATH_DBG_BTCOEX,
-				"BT scan detected");
+				"BT scan detected\n");
 			sc->sc_flags |= (SC_OP_BT_SCAN |
 					 SC_OP_BT_PRIORITY_DETECTED);
 		} else if (btcoex->bt_priority_cnt >= ATH_BT_CNT_THRESHOLD) {
 			ath_dbg(ath9k_hw_common(sc->sc_ah), ATH_DBG_BTCOEX,
-				"BT priority traffic detected");
+				"BT priority traffic detected\n");
 			sc->sc_flags |= SC_OP_BT_PRIORITY_DETECTED;
 		}
 
@@ -379,7 +379,7 @@ void ath9k_btcoex_timer_resume(struct ath_softc *sc)
 	struct ath_hw *ah = sc->sc_ah;
 
 	ath_dbg(ath9k_hw_common(ah), ATH_DBG_BTCOEX,
-		"Starting btcoex timers");
+		"Starting btcoex timers\n");
 
 	/* make sure duty cycle timer is also stopped when resuming */
 	if (btcoex->hw_timer_enabled)
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_gpio.c b/drivers/net/wireless/ath/ath9k/htc_drv_gpio.c
index d8685f0..283ff97 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_gpio.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_gpio.c
@@ -21,12 +21,12 @@ static void ath_detect_bt_priority(struct ath9k_htc_priv *priv)
 		/* Detect if colocated bt started scanning */
 		if (btcoex->bt_priority_cnt >= ATH_BT_CNT_SCAN_THRESHOLD) {
 			ath_dbg(ath9k_hw_common(ah), ATH_DBG_BTCOEX,
-				"BT scan detected");
+				"BT scan detected\n");
 			priv->op_flags |= (OP_BT_SCAN |
 					 OP_BT_PRIORITY_DETECTED);
 		} else if (btcoex->bt_priority_cnt >= ATH_BT_CNT_THRESHOLD) {
 			ath_dbg(ath9k_hw_common(ah), ATH_DBG_BTCOEX,
-				"BT priority traffic detected");
+				"BT priority traffic detected\n");
 			priv->op_flags |= OP_BT_PRIORITY_DETECTED;
 		}
 
@@ -114,8 +114,7 @@ void ath_htc_resume_btcoex_work(struct ath9k_htc_priv *priv)
 	struct ath_btcoex *btcoex = &priv->btcoex;
 	struct ath_hw *ah = priv->ah;
 
-	ath_dbg(ath9k_hw_common(ah), ATH_DBG_BTCOEX,
-		"Starting btcoex work");
+	ath_dbg(ath9k_hw_common(ah), ATH_DBG_BTCOEX, "Starting btcoex work\n");
 
 	btcoex->bt_priority_cnt = 0;
 	btcoex->bt_priority_time = jiffies;
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
index 1af31b5..87731c2 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
@@ -1133,7 +1133,7 @@ static int ath9k_htc_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
 			spin_unlock_bh(&priv->tx_lock);
 		} else {
 			ath_dbg(ath9k_hw_common(priv->ah), ATH_DBG_XMIT,
-				"Tx failed");
+				"Tx failed\n");
 		}
 		goto fail_tx;
 	}
-- 
1.7.3.2.245.g03276.dirty


^ permalink raw reply related

* [PATCH 2/2] ath: Fix logging message typos
From: Joe Perches @ 2010-12-02  5:13 UTC (permalink / raw)
  To: Jiri Slaby, Nick Kossifidis, Luis R. Rodriguez, Bob Copeland,
	Jouni Malinen
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA, ath5k-devel-xDcbHBWguxEUs3QNXV6qNA,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA, John W. Linville,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	ath9k-devel-xDcbHBWguxHbcTqmT+pZeQ
In-Reply-To: <276469c602c402565b49f99521ea19757429e81e.1291266731.git.joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>

Fix immunity misspelling.
Standardize strings from multiple modules.
Add spaces between words of concatenated strings.

Signed-off-by: Joe Perches <joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
---
 drivers/net/wireless/ath/ath5k/ani.c          |    2 +-
 drivers/net/wireless/ath/ath9k/ar9002_calib.c |    4 ++--
 drivers/net/wireless/ath/ath9k/eeprom_4k.c    |    4 ++--
 drivers/net/wireless/ath/ath9k/eeprom_9287.c  |    2 +-
 drivers/net/wireless/ath/ath9k/eeprom_def.c   |    2 +-
 drivers/net/wireless/ath/ath9k/htc_hst.c      |    6 +++---
 6 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/net/wireless/ath/ath5k/ani.c b/drivers/net/wireless/ath/ath5k/ani.c
index 6b75b22..9c41881 100644
--- a/drivers/net/wireless/ath/ath5k/ani.c
+++ b/drivers/net/wireless/ath/ath5k/ani.c
@@ -74,7 +74,7 @@ ath5k_ani_set_noise_immunity_level(struct ath5k_hw *ah, int level)
 	static const s8 fr[] = { -78, -80 };
 #endif
 	if (level < 0 || level >= ARRAY_SIZE(sz)) {
-		ATH5K_ERR(ah->ah_sc, "noise immuniy level %d out of range",
+		ATH5K_ERR(ah->ah_sc, "noise immunity level %d out of range",
 			  level);
 		return;
 	}
diff --git a/drivers/net/wireless/ath/ath9k/ar9002_calib.c b/drivers/net/wireless/ath/ath9k/ar9002_calib.c
index a7705e7..199131e 100644
--- a/drivers/net/wireless/ath/ath9k/ar9002_calib.c
+++ b/drivers/net/wireless/ath/ath9k/ar9002_calib.c
@@ -720,7 +720,7 @@ static bool ar9285_hw_cl_cal(struct ath_hw *ah, struct ath9k_channel *chan)
 		if (!ath9k_hw_wait(ah, AR_PHY_AGC_CONTROL,
 				  AR_PHY_AGC_CONTROL_CAL, 0, AH_WAIT_TIMEOUT)) {
 			ath_dbg(common, ATH_DBG_CALIBRATE,
-				"offset calibration failed to complete in 1ms; noisy ??\n");
+				"offset calibration failed to complete in 1ms; noisy environment?\n");
 			return false;
 		}
 		REG_CLR_BIT(ah, AR_PHY_TURBO, AR_PHY_FC_DYN2040_EN);
@@ -734,7 +734,7 @@ static bool ar9285_hw_cl_cal(struct ath_hw *ah, struct ath9k_channel *chan)
 	if (!ath9k_hw_wait(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_CAL,
 			  0, AH_WAIT_TIMEOUT)) {
 		ath_dbg(common, ATH_DBG_CALIBRATE,
-			"offset calibration failed to complete in 1ms; noisy ??\n");
+			"offset calibration failed to complete in 1ms; noisy enfironment?\n");
 		return false;
 	}
 
diff --git a/drivers/net/wireless/ath/ath9k/eeprom_4k.c b/drivers/net/wireless/ath/ath9k/eeprom_4k.c
index 35b1a8c..939fc7a 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom_4k.c
+++ b/drivers/net/wireless/ath/ath9k/eeprom_4k.c
@@ -90,7 +90,7 @@ static int ath9k_hw_4k_check_eeprom(struct ath_hw *ah)
 				}
 			} else {
 				ath_err(common,
-					"Invalid EEPROM Magic. endianness mismatch.\n");
+					"Invalid EEPROM Magic. Endianness mismatch.\n");
 				return -EINVAL;
 			}
 		}
@@ -1178,7 +1178,7 @@ static u16 ath9k_hw_4k_get_spur_channel(struct ath_hw *ah, u16 i, bool is2GHz)
 	u16 spur_val = AR_NO_SPUR;
 
 	ath_dbg(common, ATH_DBG_ANI,
-		"Getting spur idx %d is2Ghz. %d val %x\n",
+		"Getting spur idx:%d is2Ghz:%d val:%x\n",
 		i, is2GHz, ah->config.spurchans[i][is2GHz]);
 
 	switch (ah->config.spurmode) {
diff --git a/drivers/net/wireless/ath/ath9k/eeprom_9287.c b/drivers/net/wireless/ath/ath9k/eeprom_9287.c
index 0be5351..9ec4bc8 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom_9287.c
+++ b/drivers/net/wireless/ath/ath9k/eeprom_9287.c
@@ -1150,7 +1150,7 @@ static u16 ath9k_hw_ar9287_get_spur_channel(struct ath_hw *ah,
 	u16 spur_val = AR_NO_SPUR;
 
 	ath_dbg(common, ATH_DBG_ANI,
-		"Getting spur idx %d is2Ghz. %d val %x\n",
+		"Getting spur idx:%d is2Ghz:%d val:%x\n",
 		i, is2GHz, ah->config.spurchans[i][is2GHz]);
 
 	switch (ah->config.spurmode) {
diff --git a/drivers/net/wireless/ath/ath9k/eeprom_def.c b/drivers/net/wireless/ath/ath9k/eeprom_def.c
index 91722fb..9aa31aa 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom_def.c
+++ b/drivers/net/wireless/ath/ath9k/eeprom_def.c
@@ -1458,7 +1458,7 @@ static u16 ath9k_hw_def_get_spur_channel(struct ath_hw *ah, u16 i, bool is2GHz)
 	u16 spur_val = AR_NO_SPUR;
 
 	ath_dbg(common, ATH_DBG_ANI,
-		"Getting spur idx %d is2Ghz. %d val %x\n",
+		"Getting spur idx:%d is2Ghz:%d val:%x\n",
 		i, is2GHz, ah->config.spurchans[i][is2GHz]);
 
 	switch (ah->config.spurmode) {
diff --git a/drivers/net/wireless/ath/ath9k/htc_hst.c b/drivers/net/wireless/ath/ath9k/htc_hst.c
index c41ab8c..69b6aca 100644
--- a/drivers/net/wireless/ath/ath9k/htc_hst.c
+++ b/drivers/net/wireless/ath/ath9k/htc_hst.c
@@ -239,7 +239,7 @@ int htc_connect_service(struct htc_target *target,
 	/* Find an available endpoint */
 	endpoint = get_next_avail_ep(target->endpoint);
 	if (!endpoint) {
-		dev_err(target->dev, "Endpoint is not available for"
+		dev_err(target->dev, "Endpoint is not available for "
 			"service %d\n", service_connreq->service_id);
 		return -EINVAL;
 	}
@@ -253,7 +253,7 @@ int htc_connect_service(struct htc_target *target,
 	skb = alloc_skb(sizeof(struct htc_conn_svc_msg) +
 			    sizeof(struct htc_frame_hdr), GFP_ATOMIC);
 	if (!skb) {
-		dev_err(target->dev, "Failed to allocate buf to send"
+		dev_err(target->dev, "Failed to allocate buf to send "
 			"service connect req\n");
 		return -ENOMEM;
 	}
@@ -434,7 +434,7 @@ struct htc_target *ath9k_htc_hw_alloc(void *hif_handle,
 
 	target = kzalloc(sizeof(struct htc_target), GFP_KERNEL);
 	if (!target) {
-		printk(KERN_ERR "Unable to allocate memory for"
+		printk(KERN_ERR "Unable to allocate memory for "
 			"target device\n");
 		return NULL;
 	}
-- 
1.7.3.2.245.g03276.dirty

^ permalink raw reply related

* Re: [PATCH net-next-2.6 v6 06/20] can: EG20T PCH: Fix endianness issue
From: Tomoya MORINAGA @ 2010-12-02  4:47 UTC (permalink / raw)
  To: Marc Kleine-Budde
  Cc: andrew.chih.howe.khor-ral2JQCrhuEAvxtiuMwx3w, Samuel Ortiz,
	margie.foster-ral2JQCrhuEAvxtiuMwx3w,
	netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	socketcan-core-0fE9KPoRgkgATYTw5x5z8w,
	yong.y.wang-ral2JQCrhuEAvxtiuMwx3w,
	kok.howg.ewe-ral2JQCrhuEAvxtiuMwx3w, Wolfgang Grandegger,
	joel.clark-ral2JQCrhuEAvxtiuMwx3w, David S. Miller,
	Christian Pellegrin, qi.wang-ral2JQCrhuEAvxtiuMwx3w
In-Reply-To: <001101cb90e8$e60c76a0$66f8800a@maildom.okisemi.com>

Hi Marc,

Again, do you have any comments for v6 other patches ?
If you don't have, please give us your "Acked" for each patch.

==Current status of v6 series==
01/20: Acked
02/20:
03/20:
04/20:
05/20: Acked
06/20: I got your comments. Now modifying
07/20:
08/20:
09/20:
10/20:
11/20: Acked
12/20:
13/20: Acked
14/20:
15/20:
16/20:
17/20:
18/20:
19/20:
20/20:

Thanks,
-------
Tomoya MORINAGA
OKI SEMICONDUCTOR CO., LTD.

^ permalink raw reply

* Re: jme: UDP checksum error, and lots of them
From: Guo-Fu Tseng @ 2010-12-02  4:33 UTC (permalink / raw)
  To: David Miller, jengelh; +Cc: netdev
In-Reply-To: <20101201.200935.71110482.davem@davemloft.net>

On Wed, 01 Dec 2010 20:09:35 -0800 (PST), David Miller wrote
> From: Jan Engelhardt <jengelh@medozas.de>
> Date: Thu, 2 Dec 2010 04:39:34 +0100 (CET)
> 
> > Why does the JME driver care so much about this that it needs to print 
> > this for every packet? It does not look like it has any offloading 
> > features.
> 
> Well I'm glad it let us know about the bad checksum which would otherwise
> have been unnoticed.
> 
> Please try to pinpoint why the checksum is bad, because it seems that
> tcpdump agrees with the driver.  Perhaps it's some side effect of how
> vpnc uses TUN/TAP, or something like that.
> 
> Seeing the bad checksum even in tcpdump, and then seeing proper replies
> going back, that is very suspicious and should be looked into.
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Indeed... It is suspicious to reply proper response against the packet
with bad checksum.

Jan: Would you try to turn off the rx-checksum offloading with ethtool
and see how it goes?

I suspect that there might be some the HW-Checksum behavior error.
ex: Replaced the UDP checksum field while it's all zero(no need to checksum)

Guo-Fu Tseng


^ permalink raw reply

* Re: jme: UDP checksum error, and lots of them
From: David Miller @ 2010-12-02  4:09 UTC (permalink / raw)
  To: jengelh; +Cc: netdev, cooldavid
In-Reply-To: <alpine.LNX.2.01.1012020430190.4157@obet.zrqbmnf.qr>

From: Jan Engelhardt <jengelh@medozas.de>
Date: Thu, 2 Dec 2010 04:39:34 +0100 (CET)

> Why does the JME driver care so much about this that it needs to print 
> this for every packet? It does not look like it has any offloading 
> features.

Well I'm glad it let us know about the bad checksum which would otherwise
have been unnoticed.

Please try to pinpoint why the checksum is bad, because it seems that
tcpdump agrees with the driver.  Perhaps it's some side effect of how
vpnc uses TUN/TAP, or something like that.

Seeing the bad checksum even in tcpdump, and then seeing proper replies
going back, that is very suspicious and should be looked into.

^ permalink raw reply

* [PATCH v2 4/4] net: kill unused macros from head file
From: Shan Wei @ 2010-12-02  4:05 UTC (permalink / raw)
  To: David Miller, yoshfuji@linux-ipv6.org >> YOSHIFUJI Hideaki
  Cc: Network-Maillist, Shan Wei

These macros have been defined for several years since v2.6.12-rc2(tracing by git),
but never be used. So remove them.


Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
---
To yoshifuji-san: 
I can't find any magic number in net/ipv6/addrconf.c 
can be replaced by RETRANS_TIMER.

---
 include/net/addrconf.h  |    2 --
 include/net/ip6_route.h |    1 -
 include/net/ndisc.h     |    3 ---
 include/net/snmp.h      |    1 -
 include/net/sock.h      |    3 ---
 include/net/tcp.h       |    6 ------
 6 files changed, 0 insertions(+), 16 deletions(-)

diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index a944124..23710aa 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -1,8 +1,6 @@
 #ifndef _ADDRCONF_H
 #define _ADDRCONF_H
 
-#define RETRANS_TIMER	HZ
-
 #define MAX_RTR_SOLICITATIONS		3
 #define RTR_SOLICITATION_INTERVAL	(4*HZ)
 
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h
index 278312c..52c0550 100644
--- a/include/net/ip6_route.h
+++ b/include/net/ip6_route.h
@@ -3,7 +3,6 @@
 
 #define IP6_RT_PRIO_USER	1024
 #define IP6_RT_PRIO_ADDRCONF	256
-#define IP6_RT_PRIO_KERN	512
 
 struct route_info {
 	__u8			type;
diff --git a/include/net/ndisc.h b/include/net/ndisc.h
index 895997b..e0e594f 100644
--- a/include/net/ndisc.h
+++ b/include/net/ndisc.h
@@ -42,9 +42,6 @@ enum {
 #define ND_REACHABLE_TIME		(30*HZ)
 #define ND_RETRANS_TIMER		HZ
 
-#define ND_MIN_RANDOM_FACTOR		(1/2)
-#define ND_MAX_RANDOM_FACTOR		(3/2)
-
 #ifdef __KERNEL__
 
 #include <linux/compiler.h>
diff --git a/include/net/snmp.h b/include/net/snmp.h
index aebb553..762e2ab 100644
--- a/include/net/snmp.h
+++ b/include/net/snmp.h
@@ -60,7 +60,6 @@ struct ipstats_mib {
 };
 
 /* ICMP */
-#define ICMP_MIB_DUMMY	__ICMP_MIB_MAX
 #define ICMP_MIB_MAX	__ICMP_MIB_MAX
 struct icmp_mib {
 	unsigned long	mibs[ICMP_MIB_MAX];
diff --git a/include/net/sock.h b/include/net/sock.h
index 5557dfb..717cfbf 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -516,9 +516,6 @@ static __inline__ void sk_add_bind_node(struct sock *sk,
 #define sk_nulls_for_each_from(__sk, node) \
 	if (__sk && ({ node = &(__sk)->sk_nulls_node; 1; })) \
 		hlist_nulls_for_each_entry_from(__sk, node, sk_nulls_node)
-#define sk_for_each_continue(__sk, node) \
-	if (__sk && ({ node = &(__sk)->sk_node; 1; })) \
-		hlist_for_each_entry_continue(__sk, node, sk_node)
 #define sk_for_each_safe(__sk, node, tmp, list) \
 	hlist_for_each_entry_safe(__sk, node, tmp, list, sk_node)
 #define sk_for_each_bound(__sk, node, list) \
diff --git a/include/net/tcp.h b/include/net/tcp.h
index e36c874..ea819cc 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -100,12 +100,6 @@ extern void tcp_time_wait(struct sock *sk, int state, int timeo);
 #define TCP_SYNACK_RETRIES 5	/* number of times to retry passive opening a
 				 * connection: ~180sec is RFC minimum	*/
 
-
-#define TCP_ORPHAN_RETRIES 7	/* number of times to retry on an orphaned
-				 * socket. 7 is ~50sec-16min.
-				 */
-
-
 #define TCP_TIMEWAIT_LEN (60*HZ) /* how long to wait to destroy TIME-WAIT
 				  * state, about 60 seconds	*/
 #define TCP_FIN_TIMEOUT	TCP_TIMEWAIT_LEN
-- 
1.6.3.3

^ permalink raw reply related

* [PATCH v2 3/4] ipv6: use ND_REACHABLE_TIME and ND_RETRANS_TIMER instead of magic number
From: Shan Wei @ 2010-12-02  4:05 UTC (permalink / raw)
  To: David Miller, Network-Maillist,
	yoshfuji@linux-ipv6.org >> YOSHIFUJI Hideaki
  Cc: Shan Wei


ND_REACHABLE_TIME and ND_RETRANS_TIMER have defined 
since v2.6.12-rc2, but never been used.
So use them instead of magic number.

This patch also changes original code style to read comfortably .

Thank YOSHIFUJI Hideaki for pointing it out.

Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
---
 net/ipv6/ndisc.c |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index 998d6d2..e18f841 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -141,18 +141,18 @@ struct neigh_table nd_tbl = {
 	.proxy_redo =	pndisc_redo,
 	.id =		"ndisc_cache",
 	.parms = {
-		.tbl =			&nd_tbl,
-		.base_reachable_time =	30 * HZ,
-		.retrans_time =	 1 * HZ,
-		.gc_staletime =	60 * HZ,
-		.reachable_time =		30 * HZ,
-		.delay_probe_time =	 5 * HZ,
-		.queue_len =		 3,
-		.ucast_probes =	 3,
-		.mcast_probes =	 3,
-		.anycast_delay =	 1 * HZ,
-		.proxy_delay =		(8 * HZ) / 10,
-		.proxy_qlen =		64,
+		.tbl			= &nd_tbl,
+		.base_reachable_time	= ND_REACHABLE_TIME,
+		.retrans_time		= ND_RETRANS_TIMER,
+		.gc_staletime		= 60 * HZ,
+		.reachable_time		= ND_REACHABLE_TIME,
+		.delay_probe_time	= 5 * HZ,
+		.queue_len		= 3,
+		.ucast_probes		= 3,
+		.mcast_probes		= 3,
+		.anycast_delay		= 1 * HZ,
+		.proxy_delay		= (8 * HZ) / 10,
+		.proxy_qlen		= 64,
 	},
 	.gc_interval =	  30 * HZ,
 	.gc_thresh1 =	 128,
-- 
1.6.3.3

^ permalink raw reply related

* [PATCH v2 2/4] tcp: use TCP_BASE_MSS to set basic mss value
From: Shan Wei @ 2010-12-02  4:04 UTC (permalink / raw)
  To: David Miller, jheffner; +Cc: Network-Maillist, Shan Wei


TCP_BASE_MSS is defined, but not used.
commit 5d424d5a introduce this macro, so use
it to initial sysctl_tcp_base_mss.

commit 5d424d5a674f782d0659a3b66d951f412901faee
Author: John Heffner <jheffner@psc.edu>
Date:   Mon Mar 20 17:53:41 2006 -0800

    [TCP]: MTU probing

Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
---
 net/ipv4/tcp_output.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index bb8f547..7f65ce6 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -55,7 +55,7 @@ int sysctl_tcp_workaround_signed_windows __read_mostly = 0;
 int sysctl_tcp_tso_win_divisor __read_mostly = 3;
 
 int sysctl_tcp_mtu_probing __read_mostly = 0;
-int sysctl_tcp_base_mss __read_mostly = 512;
+int sysctl_tcp_base_mss __read_mostly = TCP_BASE_MSS;
 
 /* By default, RFC2861 behavior.  */
 int sysctl_tcp_slow_start_after_idle __read_mostly = 1;
-- 
1.6.3.3

^ permalink raw reply related

* [PATCH v2 1/4] net: snmp: fix the wrong ICMP_MIB_MAX value
From: Shan Wei @ 2010-12-02  4:04 UTC (permalink / raw)
  To: David Miller; +Cc: Network-Maillist, Shan Wei

__ICMP_MIB_MAX is equal to the total number of icmp mib,
So no need to add 1. This wastes 4/8 bytes memory.

Change it to be same as ICMP6_MIB_MAX, TCP_MIB_MAX, UDP_MIB_MAX.


Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
---
 include/net/snmp.h |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/include/net/snmp.h b/include/net/snmp.h
index a0e6180..aebb553 100644
--- a/include/net/snmp.h
+++ b/include/net/snmp.h
@@ -61,8 +61,7 @@ struct ipstats_mib {
 
 /* ICMP */
 #define ICMP_MIB_DUMMY	__ICMP_MIB_MAX
-#define ICMP_MIB_MAX	(__ICMP_MIB_MAX + 1)
-
+#define ICMP_MIB_MAX	__ICMP_MIB_MAX
 struct icmp_mib {
 	unsigned long	mibs[ICMP_MIB_MAX];
 };
-- 
1.6.3.3

^ permalink raw reply related

* Re: jme: UDP checksum error, and lots of them
From: Guo-Fu Tseng @ 2010-12-02  3:53 UTC (permalink / raw)
  To: Jan Engelhardt, netdev
In-Reply-To: <alpine.LNX.2.01.1012020430190.4157@obet.zrqbmnf.qr>

On Thu, 2 Dec 2010 04:39:34 +0100 (CET), Jan Engelhardt wrote
> On 2.6.36-rc8 (somewhat older, but the message is still there in 
> recent kernels), for almost all UDP packets transmitted/receive, I get 
> a kernel warning
> 
> Dec  2 04:30:52 localhost kernel: [  495.235252] jme 0000:02:00.5: 
> eth0: UDP Checksum error.
> 
> Apparently this has something to do with the "vpnc" connector program
> I am using, given tcpdump reports this too.
> Other than that nothing seems wrong; the VPN connection works as
> expected.
> 
> 04:31:30.700682 IP (tos 0x0, ttl 64, id 1981, offset 0, flags [DF],
>  proto UDP
> (17), length 128)    192.168.13.39.4500 > 134.76.22.1.4500: [bad udp 
> cksum 9510!] UDP-encap: ESP(spi=0xf531cf9c,seq=0x6545), length 100     
>    0x0000:  4500 0080 07bd 4000 4011 c893 c0a8 0d27  E.....@.@......'  
>       0x0010:  864c 1601 1194 1194 006c 6a9a f531 cf9c 
>  .L.......lj..1..        0x0020:  0000 6545 6b65 ec1a 5cad 484d 96ae 
> a596  ..eEke..\.HM....        0x0030:  5db7 1e93 0c15 c4d4 510b 7206 
> e821 1d56  ].......Q.r..!.V        0x0040:  c91b 1710 a8b9 6181 046a 
> 210e 7804 c2fa  ......a..j!.x...        0x0050:  6319 756c 1909 27be 
> 4086 c1d2 01eb 241a  c.ul..'.@.....$.        0x0060:  41c9 0548 dea7 
> 2496 c633 abde a601 3253  A..H..$..3....2S        0x0070:  7585 7b75 
> b587 c008 ee05 880a dc4b a3e7  u.{u.........K..
> 04:31:30.721666 IP (tos 0x0, ttl 62, id 28480, offset 0, flags [DF], 
> proto UDP
>  (17), length 1488)    134.76.22.1.4500 > 192.168.13.39.4500: [no 
> cksum] UDP-encap: ESP(spi=0x9d511170,seq=0x77eb), length 1460        
> 0x0000:  4500 05d0 6f40 4000 3e11 5dc0 864c 1601  E...o@@.>.]..L..     
>    0x0010:  c0a8 0d27 1194 1194 05bc 0000 9d51 1170  ...'.........Q.p
> 
> Why does the JME driver care so much about this that it needs to print 
> this for every packet? It does not look like it has any offloading 
> features.
I thought the error should be printed out due to it shouldn't be
happen in normal case.
It can be removed if not wanted, or change the printing to different
msglvl.
How does the Linux world prefer?

Guo-Fu Tseng


^ permalink raw reply

* jme: UDP checksum error, and lots of them
From: Jan Engelhardt @ 2010-12-02  3:39 UTC (permalink / raw)
  To: netdev; +Cc: Guo-Fu Tseng


On 2.6.36-rc8 (somewhat older, but the message is still there in recent 
kernels), for almost all UDP packets transmitted/receive, I get a kernel 
warning

Dec  2 04:30:52 localhost kernel: [  495.235252] jme 0000:02:00.5: eth0: 
UDP Checksum error.

Apparently this has something to do with the "vpnc" connector program
I am using, given tcpdump reports this too.
Other than that nothing seems wrong; the VPN connection works as
expected.

04:31:30.700682 IP (tos 0x0, ttl 64, id 1981, offset 0, flags [DF], proto UDP
(17), length 128)
    192.168.13.39.4500 > 134.76.22.1.4500: [bad udp cksum 9510!] UDP-encap:
 ESP(spi=0xf531cf9c,seq=0x6545), length 100
        0x0000:  4500 0080 07bd 4000 4011 c893 c0a8 0d27  E.....@.@......'
        0x0010:  864c 1601 1194 1194 006c 6a9a f531 cf9c  .L.......lj..1..
        0x0020:  0000 6545 6b65 ec1a 5cad 484d 96ae a596  ..eEke..\.HM....
        0x0030:  5db7 1e93 0c15 c4d4 510b 7206 e821 1d56  ].......Q.r..!.V
        0x0040:  c91b 1710 a8b9 6181 046a 210e 7804 c2fa  ......a..j!.x...
        0x0050:  6319 756c 1909 27be 4086 c1d2 01eb 241a  c.ul..'.@.....$.
        0x0060:  41c9 0548 dea7 2496 c633 abde a601 3253  A..H..$..3....2S
        0x0070:  7585 7b75 b587 c008 ee05 880a dc4b a3e7  u.{u.........K..
04:31:30.721666 IP (tos 0x0, ttl 62, id 28480, offset 0, flags [DF], proto UDP
 (17), length 1488)
    134.76.22.1.4500 > 192.168.13.39.4500: [no cksum] UDP-encap:
 ESP(spi=0x9d511170,seq=0x77eb), length 1460
        0x0000:  4500 05d0 6f40 4000 3e11 5dc0 864c 1601  E...o@@.>.]..L..
        0x0010:  c0a8 0d27 1194 1194 05bc 0000 9d51 1170  ...'.........Q.p

Why does the JME driver care so much about this that it needs to print 
this for every packet? It does not look like it has any offloading 
features.

# ethtool eth0
Settings for eth0:
        Supported ports: [ TP MII ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
        Advertised auto-negotiation: Yes
        Speed: 100Mb/s
        Duplex: Full
        Port: MII
        PHYAD: 1
        Transceiver: internal
        Auto-negotiation: on
        Supports Wake-on: pg
        Wake-on: g
        Current message level: 0x000020c6 (8390)
        Link detected: yes

# lspci
02:00.5 Ethernet controller: JMicron Technology Corp. JMC260 PCI 
Express Fast Ethernet Controller (rev 02)
02:00.5 0200: 197b:0260 (rev 02)


^ permalink raw reply

* Re: [Patch] net: kill an RCU warning in inet_fill_link_af()
From: Cong Wang @ 2010-12-02  3:14 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: linux-kernel, David S. Miller, Alexey Kuznetsov,
	Pekka Savola (ipv6), James Morris, Hideaki YOSHIFUJI,
	Patrick McHardy, netdev, Thomas Graf
In-Reply-To: <1291219386.2856.924.camel@edumazet-laptop>

On 12/02/10 00:03, Eric Dumazet wrote:
> Le mercredi 01 décembre 2010 à 19:14 +0800, Amerigo Wang a écrit :
>> From: WANG Cong<amwang@redhat.com>
>>
>> The latest net-next-2.6 triggers an RCU warning during boot,
>> lockdep complains that in inet_fill_link_af() we call rcu_dereference_check()
>> without rcu_read_lock() protection.
>>
>> This patch fixes it by replacing __in_dev_get_rcu() with in_dev_get().
>
> Here is a better version, thanks a lot for your report and initial
> patch.
>
>
> [PATCH net-next-2.6] net: kill an RCU warning in inet_fill_link_af()
>
> commits 9f0f7272 (ipv4: AF_INET link address family) and cf7afbfeb8c
> (rtnl: make link af-specific updates atomic) used incorrect
> __in_dev_get_rcu() in RTNL protected contexts, triggering PROVE_RCU
> warnings.
>
> Switch to __in_dev_get_rtnl(), wich is more appropriate, since we hold
> RTNL.
>
> Based on a report and initial patch from Amerigo Wang.
>

Alright, thanks for fixing it.

Reviewed-by: WANG Cong <amwang@redhat.com>

^ permalink raw reply

* Re: [Patch] bonding: clean up netpoll code
From: Cong Wang @ 2010-12-02  3:14 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: linux-kernel, Jiri Pirko, Neil Horman, netdev, David S. Miller,
	Eric W. Biederman, Herbert Xu, bonding-devel, Jay Vosburgh
In-Reply-To: <20101201081457.23102445@nehalam>

On 12/02/10 00:14, Stephen Hemminger wrote:
> On Wed, 1 Dec 2010 02:45:45 -0500
> Amerigo Wang<amwang@redhat.com>  wrote:
>
>> +	if ((slave_dev->npinfo = bond_netpoll_info(bond))) {
>
> Split assignment and conditional into two lines
>

Ok, will change this in the next update.

Thanks!

^ permalink raw reply

* Re: [PATCH net-next-2.6] filter: add a security check at install time
From: Changli Gao @ 2010-12-02  2:30 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: David Miller, hagen, wirelesser, netdev, Dan Rosenberg
In-Reply-To: <1291236342.2856.1057.camel@edumazet-laptop>

On Thu, Dec 2, 2010 at 4:45 AM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> Le mercredi 01 décembre 2010 à 12:23 -0800, David Miller a écrit :
>> From: Eric Dumazet <eric.dumazet@gmail.com>
>> Date: Wed, 01 Dec 2010 20:48:57 +0100
>>
>> > Le mercredi 01 décembre 2010 à 10:44 -0800, David Miller a écrit :
>> >> From: Eric Dumazet <eric.dumazet@gmail.com>
>> >> Date: Wed, 01 Dec 2010 19:24:53 +0100
>> >>
>> >> > A third work in progress (from my side) is to add a check in
>> >> > sk_chk_filter() to remove the memvalid we added lately to protect the
>> >> > LOAD M(K).
>> >>
>> >> I understand your idea, but the static checkers are still going to
>> >> complain.  So better add a huge comment in sk_run_filter() explaining
>> >> why the checker's complaint should be ignored :-)
>> >
>> > Sure, here is the patch I plan to test ASAP
>>
>> Looks good to me.
>
> Yes, it survives tests I did.
>
> I submit the patch and Cc Dan Rosenberg, I would like him to double
> check it if he likes.
>
> Thanks
>
> [PATCH net-next-2.6] filter: add a security check at install time
>
> We added some security checks in commit 57fe93b374a6
> (filter: make sure filters dont read uninitialized memory) to close a
> potential leak of kernel information to user.
>
> This added a potential extra cost at run time, while we can perform a
> check of the filter itself, to make sure a malicious user doesnt try to
> abuse us.
>
> This patch adds a check_loads() function, whole unique purpose is to
> make this check, allocating a temporary array of mask. We scan the
> filter and propagate a bitmask information, telling us if a load M(K) is
> allowed because a previous store M(K) is guaranteed. (So that
> sk_run_filter() can possibly not read unitialized memory)
>
> Note: this can uncover application bug, denying a filter attach,
> previously allowed.
>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
> Cc: Dan Rosenberg <drosenberg@vsecurity.com>
> ---
>  net/core/filter.c |   70 ++++++++++++++++++++++++++++++++++++++------
>  1 file changed, 61 insertions(+), 9 deletions(-)
>
> diff --git a/net/core/filter.c b/net/core/filter.c
> index a44d27f..00a0d50 100644
> --- a/net/core/filter.c
> +++ b/net/core/filter.c
> @@ -166,11 +166,9 @@ unsigned int sk_run_filter(struct sk_buff *skb, const struct sock_filter *fentry
>        u32 A = 0;                      /* Accumulator */
>        u32 X = 0;                      /* Index Register */
>        u32 mem[BPF_MEMWORDS];          /* Scratch Memory Store */
> -       unsigned long memvalid = 0;
>        u32 tmp;
>        int k;
>
> -       BUILD_BUG_ON(BPF_MEMWORDS > BITS_PER_LONG);
>        /*
>         * Process array of filter instructions.
>         */
> @@ -318,12 +316,10 @@ load_b:
>                        X = K;
>                        continue;
>                case BPF_S_LD_MEM:
> -                       A = (memvalid & (1UL << K)) ?
> -                               mem[K] : 0;
> +                       A = mem[K];
>                        continue;
>                case BPF_S_LDX_MEM:
> -                       X = (memvalid & (1UL << K)) ?
> -                               mem[K] : 0;
> +                       X = mem[K];
>                        continue;
>                case BPF_S_MISC_TAX:
>                        X = A;
> @@ -336,11 +332,9 @@ load_b:
>                case BPF_S_RET_A:
>                        return A;
>                case BPF_S_ST:
> -                       memvalid |= 1UL << K;
>                        mem[K] = A;
>                        continue;
>                case BPF_S_STX:
> -                       memvalid |= 1UL << K;
>                        mem[K] = X;
>                        continue;
>                default:
> @@ -419,6 +413,64 @@ load_b:
>  }
>  EXPORT_SYMBOL(sk_run_filter);
>
> +/*
> + * Security :
> + * A BPF program is able to use 16 cells of memory to store intermediate
> + * values (check u32 mem[BPF_MEMWORDS] in sk_run_filter())
> + * As we dont want to clear mem[] array for each packet going through
> + * sk_run_filter(), we check that filter loaded by user never try to read
> + * a cell if not previously written, and we check all branches to be sure
> + * a malicious user doesnt try to abuse us.
> + */
> +static int check_loads(struct sock_filter *filter, int flen)
> +{
> +       u16 *masks, memvalid = 0; /* one bit per cell, 16 cells */
> +       int pc, ret = 0;
> +
> +       BUILD_BUG_ON(BPF_MEMWORDS > 16);
> +       masks = kmalloc(flen * sizeof(*masks), GFP_KERNEL);
> +       if (!masks)
> +               return -ENOMEM;
> +       memset(masks, 0xff, flen * sizeof(*masks));
> +
> +       for (pc = 0; pc < flen; pc++) {
> +               memvalid &= masks[pc];
> +

It seems wrong. Think about the following instructions:

/* m[1] isn't set */
   jeq jt jf
jt:
   st m[1]
   jmp ja
jf:
   jmp ja2 /* m[1] is invalidated by masks */
ja:
   ld m[1] /* -EINVAL is returned */
ja2:

So you need to search all the possible branches to validate the instructions.

> +               switch (filter[pc].code) {
> +               case BPF_S_ST:
> +               case BPF_S_STX:
> +                       memvalid |= (1 << filter[pc].k);
> +                       break;
> +               case BPF_S_LD_MEM:
> +               case BPF_S_LDX_MEM:
> +                       if (!(memvalid & (1 << filter[pc].k))) {
> +                               ret = -EINVAL;
> +                               goto error;
> +                       }
> +                       break;
> +               case BPF_S_JMP_JA:
> +                       /* a jump must set masks on target */
> +                       masks[pc + 1 + filter[pc].k] &= memvalid;
> +                       break;
> +               case BPF_S_JMP_JEQ_K:
> +               case BPF_S_JMP_JEQ_X:
> +               case BPF_S_JMP_JGE_K:
> +               case BPF_S_JMP_JGE_X:
> +               case BPF_S_JMP_JGT_K:
> +               case BPF_S_JMP_JGT_X:
> +               case BPF_S_JMP_JSET_X:
> +               case BPF_S_JMP_JSET_K:
> +                       /* a jump must set masks on targets */
> +                       masks[pc + 1 + filter[pc].jt] &= memvalid;
> +                       masks[pc + 1 + filter[pc].jf] &= memvalid;
> +                       break;
> +               }
> +       }
> +error:
> +       kfree(masks);
> +       return ret;
> +}
> +
>  /**
>  *     sk_chk_filter - verify socket filter code
>  *     @filter: filter to verify
> @@ -547,7 +599,7 @@ int sk_chk_filter(struct sock_filter *filter, int flen)
>        switch (filter[flen - 1].code) {
>        case BPF_S_RET_K:
>        case BPF_S_RET_A:
> -               return 0;
> +               return check_loads(filter, flen);
>        }
>        return -EINVAL;
>  }
>
>
>



-- 
Regards,
Changli Gao(xiaosuo@gmail.com)

^ permalink raw reply

* Re: [PATCH net-next-2.6] Fix a typo in datagram.c
From: Shan Wei @ 2010-12-02  1:35 UTC (permalink / raw)
  To: David Shwatrz; +Cc: David S. Miller, netdev
In-Reply-To: <AANLkTin21SMZ8Oe5yagYkk+3ZZtfXF4iEyMnwaryFExa@mail.gmail.com>

David Shwatrz wrote, at 12/02/2010 03:46 AM:
> Hi,
> This path fixes a typo in net/core/datagram.c

This typo does not influence our reading. right?
And, you lost some ones.

$ grep -r corrent .
./net/core/datagram.c:		 * However, this function was corrent in any case. 8)
./net/sctp/socket.c:		 *  However, this function was corrent in any case. 8)
./drivers/serial/max3107.c:	/* if can't find the corrent config, use previous */
./drivers/gpu/drm/i915/intel_hdmi.c:	/* XXX first guess at handling video port, is this corrent? */

-- 
Best Regards
-----
Shan Wei

> 
> Regards,
> David Shwartz
> 
> Signed-off-by: David Shwartz <dshwatrz@gmail.com>





^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox