Netdev List
 help / color / mirror / Atom feed
* Re: NETPOLL=y , NETDEVICES=n compile error ( Re: 2.6.23-rc1-mm1 )
From: Jarek Poplawski @ 2007-08-01  9:59 UTC (permalink / raw)
  To: Gabriel C; +Cc: Andrew Morton, linux-kernel, netdev, jason.wessel, amitkale
In-Reply-To: <46AF4F9C.5060000@googlemail.com>

On Tue, Jul 31, 2007 at 05:05:00PM +0200, Gabriel C wrote:
> Jarek Poplawski wrote:
> > On Tue, Jul 31, 2007 at 12:14:36PM +0200, Gabriel C wrote:
> >> Jarek Poplawski wrote:
> >>> On 28-07-2007 20:42, Gabriel C wrote:
> >>>> Andrew Morton wrote:
> >>>>> On Sat, 28 Jul 2007 17:44:45 +0200 Gabriel C <nix.or.die@googlemail.com> wrote:
> >>>>>
> >>>>>> Hi,
> >>>>>>
> >>>>>> I got this compile error with a randconfig ( http://194.231.229.228/MM/randconfig-auto-82.broken.netpoll.c ).
> >>>>>>
> >>>>>> ...
> >>>>>>
> >>>>>> net/core/netpoll.c: In function 'netpoll_poll':
> >>>>>> net/core/netpoll.c:155: error: 'struct net_device' has no member named 'poll_controller'
> >>>>>> net/core/netpoll.c:159: error: 'struct net_device' has no member named 'poll_controller'
> >>>>>> net/core/netpoll.c: In function 'netpoll_setup':
> >>>>>> net/core/netpoll.c:670: error: 'struct net_device' has no member named 'poll_controller'
> >>>>>> make[2]: *** [net/core/netpoll.o] Error 1
> >>>>>> make[1]: *** [net/core] Error 2
> >>>>>> make: *** [net] Error 2
> >>>>>> make: *** Waiting for unfinished jobs....
> >>>>>>
> >>>>>> ...
> >>>>>>
> >>>>>>
> >>>>>> I think is because KGDBOE selects just NETPOLL.
> >>>>>>
> >>>>> Looks like it.
> >>>>>
> >>>>> Select went and selected NETPOLL and NETPOLL_TRAP but things like
> >>>>> CONFIG_NETDEVICES and CONFIG_NET_POLL_CONTROLLER remain unset.  `select'
> >>>>> remains evil.
> >>> ...
> >>>> I think there may be a logical issue ( again if I got it right ).
> >>>> We need some ethernet card to work with kgdboe right ? but we don't have any if !NETDEVICES && !NET_ETHERNET.
> >>>>
> >>>> So maybe some ' depends on ... && NETDEVICES!=n && NET_ETHERNET!=n ' is needed too ? 
> >>> IMHO, the only logical issue here is netpoll.c mustn't use 
> >>> CONFIG_NET_POLL_CONTROLLER code without #ifdef if it doesn't
> >>> add this dependency itself.
> >>>
> >> Well it does if NETDEVICES && if NET_ETHERNET which booth are N when !NETDEVICES is why KGDBOE uses select and not depends on.
> > 
> > "does if XXX" means may "use if XXX".
> 
> From what I know means only use "if xxx" on !xxx everything inside the "if xxx" is n and "depends on <something inside the if xxx> 
> does not work.
> 
> ...
> 
> menuconfig FOO
> 	bool "FOO"
> 	depends on BAR
> 	default y 
> 	-- help --
> 	something
> if FOO
> 
> config BAZ
> 	depends on WHATEVR && !NOT_THIS
> 
> menuconfig SOMETHING_ELSE
> 	....
> if SOMETHING_ELSE
> 
> config BLUBB
> 	depends on PCI && WHATNOT
> 
> endif # SOMETHING_ELSE
> 
> config NETPOLL
>         def_bool NETCONSOLE
>         
> config NETPOLL_TRAP
>         bool "Netpoll traffic trapping"
>         default n
>         depends on NETPOLL
>           
> config NET_POLL_CONTROLLER
>         def_bool NETPOLL
> 
> endif # FOO
> 
> Now if you set FOO=n all is gone and your driver have to select whatever it needs from there.

Probably not exactly so...

>From drivers/net/Kconfig:

> # All the following symbols are dependent on NETDEVICES - do not repeat
> # that for each of the symbols.
> if NETDEVICES

So, according to this netpoll could presume NETDEVICES and
NET_POLL_CONTROLLER are always on.

But, as you've found, it's possible to select NETPOLL and !NETDEVICES,
so this comment is at least not precise.

On the other side something like this:

...
endif # NETDEVICES

config NETPOLL
        depends on NETDEVICES
        def_bool NETCONSOLE

config NETPOLL_TRAP
        bool "Netpoll traffic trapping"
        default n
        depends on NETPOLL

config NET_POLL_CONTROLLER
        def_bool NETPOLL
        depends on NETPOLL


seems to select NET_POLL_CONTROLLER after selecting NETPOLL, but
still doesn't check for NETDEVICES dependency.

> 
> > 
> >> Now KGDBOE just selects NETPOLL and NETPOLL_TRAP.
> >> Adding 'select CONFIG_NET_POLL_CONTROLLER' let kgdboe compiles but the question is does it work without any ethernet card ?
> > 
> > Why kgdboe should care what netpoll needs? So, I hope, you are adding
> > this select under config NETPOLL. On the other hand, if NETPOLL should
> > depend on NET_POLL_CONTROLLER there is probably no reason to have them
> > both.
> 
> NET_POLL_CONTROLLER has def_bool NETPOLL if NETDEVICES .
> 
> Net peoples ping ?:)

OK, I wasn't right here: there is no visible reason for both in the
kernel code, but I can imagine there could be some external users of
NET_POLL_CONTROLLER without NETPOLL.

> 
> > 
> > The "does it work" question isn't logical issue, so it's irrelevant
> > here...
> 
> Right irrelevant for the compile error but relevant for the fix in my opinion.

This was kind of joking, but since some people prefer things to work,
and it's hard to do this right (logical) way, some strange (unlogical)
measures have to be done like repeating dependencies here.

Regards,
Jarek P.

^ permalink raw reply

* Re: [PATCH] SCTP: drop SACK if ctsn is not less than the next tsn of assoc
From: Wei Yongjun @ 2007-08-01 10:21 UTC (permalink / raw)
  To: Vlad Yasevich; +Cc: Sridhar Samudrala, netdev, lksctp-developers, Neil Horman
In-Reply-To: <46AFFAB7.8050503@hp.com>


> Sorry, coming in late due to list issues...
>
> Wei Yongjun wrote:
>   
>>> On Tue, 2007-07-31 at 07:37 -0400, Neil Horman wrote:
>>>   
>>>       
>>>> On Tue, Jul 31, 2007 at 12:44:27PM +0800, Wei Yongjun wrote:
>>>>     
>>>>         
>>>>> If SCTP data sender received a SACK which contains Cumulative TSN Ack is 
>>>>> not less than the Cumulative TSN Ack Point, and if this Cumulative TSN 
>>>>> Ack is not used by the data sender, SCTP data sender still accept this 
>>>>> SACK , and next SACK which send correctly to DATA sender be dropped, 
>>>>> because it is less than the new Cumulative TSN Ack Point.
>>>>> After received this SACK, data will be retrans again and again even if 
>>>>> correct SACK is received.
>>>>> So I think this SACK must be dropped to let data transmit  correctly.
>>>>>
>>>>> Following is the tcpdump of my test. And patch in this mail can avoid 
>>>>> this problem.
>>>>>
>>>>> 02:19:38.233278 sctp (1) [INIT] [init tag: 1250461886] [rwnd: 54784] [OS: 10] [MIS: 65535] [init TSN: 217114040] 
>>>>> 02:19:39.782160 sctp (1) [INIT ACK] [init tag: 1] [rwnd: 54784] [OS: 100] [MIS: 65535] [init TSN: 100] 
>>>>> 02:19:39.798583 sctp (1) [COOKIE ECHO] 
>>>>> 02:19:40.082125 sctp (1) [COOKIE ACK] 
>>>>> 02:19:40.097859 sctp (1) [DATA] (B)(E) [TSN: 217114040] [SID: 0] [SSEQ 0] [PPID 0xf192090b] 
>>>>> 02:19:40.100162 sctp (1) [DATA] (B)(E) [TSN: 217114041] [SID: 0] [SSEQ 1] [PPID 0x3e467007] 
>>>>> 02:19:40.100779 sctp (1) [DATA] (B)(E) [TSN: 217114042] [SID: 0] [SSEQ 2] [PPID 0x11b12a0a] 
>>>>> 02:19:40.101200 sctp (1) [DATA] (B)(E) [TSN: 217114043] [SID: 0] [SSEQ 3] [PPID 0x30e7d979] 
>>>>> 02:19:40.561147 sctp (1) [SACK] [cum ack 217114040] [a_rwnd 54784] [#gap acks 0] [#dup tsns 0] 
>>>>> 02:19:40.568498 sctp (1) [DATA] (B)(E) [TSN: 217114044] [SID: 0] [SSEQ 4] [PPID 0x251ff86f] 
>>>>> 02:19:40.569308 sctp (1) [DATA] (B)(E) [TSN: 217114045] [SID: 0] [SSEQ 5] [PPID 0xe5d5da5d] 
>>>>> 02:19:40.700584 sctp (1) [SACK] [cum ack 290855864] [a_rwnd 54784] [#gap acks 0] [#dup tsns 0] 
>>>>> 02:19:40.701562 sctp (1) [DATA] (B)(E) [TSN: 217114046] [SID: 0] [SSEQ 6] [PPID 0x87d8b423] 
>>>>> 02:19:40.701567 sctp (1) [DATA] (B)(E) [TSN: 217114047] [SID: 0] [SSEQ 7] [PPID 0xca47e645] 
>>>>> 02:19:40.701569 sctp (1) [DATA] (B)(E) [TSN: 217114048] [SID: 0] [SSEQ 8] [PPID 0x6c0ea150] 
>>>>> 02:19:40.701576 sctp (1) [DATA] (B)(E) [TSN: 217114049] [SID: 0] [SSEQ 9] [PPID 0x9cc1994f] 
>>>>> 02:19:40.701585 sctp (1) [DATA] (B)(E) [TSN: 217114050] [SID: 0] [SSEQ 10] [PPID 0xb1df4129] 
>>>>> 02:19:41.098201 sctp (1) [SACK] [cum ack 217114041] [a_rwnd 54784] [#gap acks 0] [#dup tsns 0] 
>>>>> 02:19:41.283257 sctp (1) [SACK] [cum ack 217114042] [a_rwnd 54784] [#gap acks 0] [#dup tsns 0] 
>>>>> 02:19:41.457217 sctp (1) [SACK] [cum ack 217114043] [a_rwnd 54784] [#gap acks 0] [#dup tsns 0] 
>>>>> 02:19:41.691528 sctp (1) [SACK] [cum ack 217114044] [a_rwnd 54784] [#gap acks 0] [#dup tsns 0] 
>>>>> 02:19:41.849636 sctp (1) [SACK] [cum ack 217114045] [a_rwnd 54784] [#gap acks 0] [#dup tsns 0] 
>>>>> 02:19:41.975473 sctp (1) [DATA] (B)(E) [TSN: 217114046] [SID: 0] [SSEQ 6] [PPID 0x87d8b423] 
>>>>> 02:19:42.021229 sctp (1) [SACK] [cum ack 217114046] [a_rwnd 54784] [#gap acks 0] [#dup tsns 0] 
>>>>> 02:19:42.196495 sctp (1) [SACK] [cum ack 217114047] [a_rwnd 54784] [#gap acks 0] [#dup tsns 0] 
>>>>> 02:19:42.424319 sctp (1) [SACK] [cum ack 217114048] [a_rwnd 54784] [#gap acks 0] [#dup tsns 0] 
>>>>> 02:19:42.586924 sctp (1) [SACK] [cum ack 217114049] [a_rwnd 54784] [#gap acks 0] [#dup tsns 0] 
>>>>> 02:19:42.744810 sctp (1) [SACK] [cum ack 217114050] [a_rwnd 54784] [#gap acks 0] [#dup tsns 0] 
>>>>> 02:19:42.965536 sctp (1) [SACK] [cum ack 217114046] [a_rwnd 54784] [#gap acks 0] [#dup tsns 0] 
>>>>> 02:19:43.106385 sctp (1) [DATA] (B)(E) [TSN: 217114046] [SID: 0] [SSEQ 6] [PPID 0x87d8b423] 
>>>>> 02:19:43.218969 sctp (1) [SACK] [cum ack 217114046] [a_rwnd 54784] [#gap acks 0] [#dup tsns 0] 
>>>>> 02:19:45.374101 sctp (1) [DATA] (B)(E) [TSN: 217114046] [SID: 0] [SSEQ 6] [PPID 0x87d8b423] 
>>>>> 02:19:45.489258 sctp (1) [SACK] [cum ack 217114046] [a_rwnd 54784] [#gap acks 0] [#dup tsns 0] 
>>>>> 02:19:49.830116 sctp (1) [DATA] (B)(E) [TSN: 217114046] [SID: 0] [SSEQ 6] [PPID 0x87d8b423] 
>>>>> 02:19:49.984577 sctp (1) [SACK] [cum ack 217114046] [a_rwnd 54784] [#gap acks 0] [#dup tsns 0] 
>>>>> 02:19:58.760300 sctp (1) [DATA] (B)(E) [TSN: 217114046] [SID: 0] [SSEQ 6] [PPID 0x87d8b423] 
>>>>> 02:19:58.931690 sctp (1) [SACK] [cum ack 217114046] [a_rwnd 54784] [#gap acks 0] [#dup tsns 0] 
>>>>>           
>
>   
> This is an interesting case, but I am not sure that simply discarding
> the SACK is the right thing.
>
> The peer in this case is violating the protocol whereby he is trying to
> advance the cumulative tsn ack to a point beyond the max tsn currently
> sent. I would vote for terminating the association in this case since
> either the peer is a mis-behaved implementation, or the association is
> under attack.
I have modify the patch to abort the association with protocol violation 
error cause, and new patch is come on. May be this patch is correct.^_^

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>

--- net/sctp/sm_statefuns.c.orig	2007-07-29 18:11:01.000000000 -0400
+++ net/sctp/sm_statefuns.c	2007-07-31 00:29:16.000000000 -0400
@@ -104,6 +104,13 @@ static sctp_disposition_t sctp_sf_violat
 				     void *arg,
 				     sctp_cmd_seq_t *commands);
 
+static sctp_disposition_t sctp_sf_violation_ctsn(
+				     const struct sctp_endpoint *ep,
+				     const struct sctp_association *asoc,
+				     const sctp_subtype_t type,
+				     void *arg,
+				     sctp_cmd_seq_t *commands);
+
 /* Small helper function that checks if the chunk length
  * is of the appropriate length.  The 'required_length' argument
  * is set to be the size of a specific chunk we are testing.
@@ -2880,6 +2887,13 @@ sctp_disposition_t sctp_sf_eat_sack_6_2(
 		return SCTP_DISPOSITION_DISCARD;
 	}
 
+	/* If Cumulative TSN Ack beyond the max tsn currently
+	 * send, terminating the association and respond to the 
+	 * sender with an ABORT.
+	 */
+	if (!TSN_lt(ctsn, asoc->next_tsn))
+		return sctp_sf_violation_ctsn(ep, asoc, type, arg, commands);
+
 	/* Return this SACK for further processing.  */
 	sctp_add_cmd_sf(commands, SCTP_CMD_PROCESS_SACK, SCTP_SACKH(sackh));
 
@@ -3756,6 +3770,68 @@ nomem:
 	return SCTP_DISPOSITION_NOMEM;
 }
 
+/*
+ * Handle a protocol violation when the peer trying to advance the 
+ * cumulative tsn ack to a point beyond the max tsn currently sent.
+ *
+ * We inform the other end by sending an ABORT with a Protocol Violation
+ * error code.
+ *
+ * Section: Not specified
+ * Verification Tag:  Nothing to do
+ * Inputs
+ * (endpoint, asoc, chunk)
+ *
+ * Outputs
+ * (reply_msg, msg_up, counters)
+ *
+ * Generate an  ABORT chunk and terminate the association.
+ */
+static sctp_disposition_t sctp_sf_violation_ctsn(
+				     const struct sctp_endpoint *ep,
+				     const struct sctp_association *asoc,
+				     const sctp_subtype_t type,
+				     void *arg,
+				     sctp_cmd_seq_t *commands)
+{
+	struct sctp_chunk *chunk =  arg;
+	struct sctp_chunk *abort = NULL;
+	char err_str[] = "The cumulative tsn ack beyond the max tsn currently sent:";
+
+	/* Make the abort chunk. */
+	abort = sctp_make_abort_violation(asoc, chunk, err_str,
+					  sizeof(err_str));
+	if (!abort)
+		goto nomem;
+
+	sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(abort));
+	SCTP_INC_STATS(SCTP_MIB_OUTCTRLCHUNKS);
+
+	if (asoc->state <= SCTP_STATE_COOKIE_ECHOED) {
+		sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_STOP,
+				SCTP_TO(SCTP_EVENT_TIMEOUT_T1_INIT));
+		sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR,
+				SCTP_ERROR(ECONNREFUSED));
+		sctp_add_cmd_sf(commands, SCTP_CMD_INIT_FAILED,
+				SCTP_PERR(SCTP_ERROR_PROTO_VIOLATION));
+	} else {
+		sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR,
+				SCTP_ERROR(ECONNABORTED));
+		sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED,
+				SCTP_PERR(SCTP_ERROR_PROTO_VIOLATION));
+		SCTP_DEC_STATS(SCTP_MIB_CURRESTAB);
+	}
+
+	sctp_add_cmd_sf(commands, SCTP_CMD_DISCARD_PACKET, SCTP_NULL());
+
+	SCTP_INC_STATS(SCTP_MIB_ABORTEDS);
+
+	return SCTP_DISPOSITION_ABORT;
+
+nomem:
+	return SCTP_DISPOSITION_NOMEM;
+}
+
 /***************************************************************************
  * These are the state functions for handling primitive (Section 10) events.
  ***************************************************************************/



-- 

A new email address of FJWAN is launched from Apr.1 2007.
The updated address is: yjwei@cn.fujitsu.com 
--------------------------------------------------
Wei Yongjun
Development Dept.I
Nanjing Fujitsu Nanda Software Tech. Co., Ltd.(FNST)
8/F., Civil Defense Building, No.189 Guangzhou Road,
Nanjing, 210029, China
TEL: +86+25-86630523-858
COINS: 79955-858
FAX: +86+25-83317685
MAIL: yjwei@cn.fujitsu.com
--------------------------------------------------


^ permalink raw reply

* Re: [Lksctp-developers] [PATCH] SCTP: drop SACK if ctsn is not less than the next tsn of assoc
From: Neil Horman @ 2007-08-01 11:19 UTC (permalink / raw)
  To: Michael Tuexen; +Cc: Wei Yongjun, Sridhar Samudrala, netdev, lksctp-developers
In-Reply-To: <5BCC24EA-FACD-4B5D-BD1C-2DB11DEDB46D@lurchi.franken.de>

On Wed, Aug 01, 2007 at 11:01:21AM +0200, Michael Tuexen wrote:
> Hi Wei,
> 
> see my comments in-line.
> 
> Best regards
> Michael
> 
><snip >
> >(*1) At this point ctsn_ack_point=0,next_tsn=2, ctsn=1, SACK is  
> >accept.
> >After accept SACK, ctsn_ack_point=1.
> >(*2) At this point ctsn_ack_point=1,next_tsn=6, ctsn=5,TSN_lt(ctsn,
> >ctsn_ack_point) is ture, so accept SACK, and then ctsn_ack_point=5
> >(*3) At this point SACK is a dup SACK, ctsn_ack_point=5,next_tsn=6,
> >ctsn=1000,TSN_lt(ctsn, ctsn_ack_point) is ture, so accept SACK, and  
> >then
> >ctsn_ack_point=1000
> I would not consider it a duplicate SACK. RFC 4460, section 2.37.2 says
> that an implementation SHOULD abort the association when receiving a
> SACK acknowledging unsent data. So I would suggest to send an ABORT  
> chunk.

+1.  I didn't notice the ctsn value before.  We can't safely accept that a peer
pre-acks data we haven't sent.  Too many security holes.  

Neil



-- 
/***************************************************
 *Neil Horman
 *Software Engineer
 *Red Hat, Inc.
 *nhorman@tuxdriver.com
 *gpg keyid: 1024D / 0x92A74FA1
 *http://pgp.mit.edu
 ***************************************************/

^ permalink raw reply

* netconf 2007
From: Andy Johnson @ 2007-08-01 11:59 UTC (permalink / raw)
  To: netdev

Hello,

-   I used to follow the slides of netconf in recent years (2004-2006).

- I  found quite an interest in the slides.

- I was just wondering: is there going to be netconf in 2007 ? I could
not find any info about it.


Regards,
JA

^ permalink raw reply

* Re: [PATCH] prevent SSB compilation on s390 part 2
From: John W. Linville @ 2007-08-01 12:24 UTC (permalink / raw)
  To: Heiko Carstens
  Cc: Andrew Morton, linux-kernel, netdev, Michael Buesch,
	Martin Schwidefsky
In-Reply-To: <20070801093404.GA12124@osiris.boeblingen.de.ibm.com>

On Wed, Aug 01, 2007 at 11:34:04AM +0200, Heiko Carstens wrote:
> From: Heiko Carstens <heiko.carstens@de.ibm.com>
> 
> drivers/ssb/Kconfig has already a depends on HAS_IOMEM which should
> prevent SSB from being selected. But appearantly it looks like this
> doesn't matter at all if it gets selected from somewhere else.
> So add an explicit depends on HAS_IOMEM to the Broadcom driver to
> prevent selection on s390.
> 
> Cc: "John W. Linville" <linville@tuxdriver.com>
> Cc: Michael Buesch <mb@bu3sch.de>
> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>

Note to reviewers: this is only relevant to -mm and wireless-dev at
the moment, AFAIK...

John
-- 
John W. Linville
linville@tuxdriver.com

^ permalink raw reply

* Re: [Lksctp-developers] [PATCH] SCTP: drop SACK if ctsn is not less than the next tsn of assoc
From: Vlad Yasevich @ 2007-08-01 13:06 UTC (permalink / raw)
  To: Wei Yongjun; +Cc: netdev, Neil Horman, lksctp-developers, Sridhar Samudrala
In-Reply-To: <46B05EA9.4090507@cn.fujitsu.com>

This is a little better.

One suggestion.  The new function you create is almost exactly like
sctp_sf_violation_chunklen() with the exception of the error string.
Can you extract the common parts into a single function so that
we don't have duplication of code.

Thanks
-vlad

Wei Yongjun wrote:
>>   
>> This is an interesting case, but I am not sure that simply discarding
>> the SACK is the right thing.
>>
>> The peer in this case is violating the protocol whereby he is trying to
>> advance the cumulative tsn ack to a point beyond the max tsn currently
>> sent. I would vote for terminating the association in this case since
>> either the peer is a mis-behaved implementation, or the association is
>> under attack.
> I have modify the patch to abort the association with protocol violation 
> error cause, and new patch is come on. May be this patch is correct.^_^
> 
> Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
> 
> --- net/sctp/sm_statefuns.c.orig	2007-07-29 18:11:01.000000000 -0400
> +++ net/sctp/sm_statefuns.c	2007-07-31 00:29:16.000000000 -0400
> @@ -104,6 +104,13 @@ static sctp_disposition_t sctp_sf_violat
>  				     void *arg,
>  				     sctp_cmd_seq_t *commands);
>  
> +static sctp_disposition_t sctp_sf_violation_ctsn(
> +				     const struct sctp_endpoint *ep,
> +				     const struct sctp_association *asoc,
> +				     const sctp_subtype_t type,
> +				     void *arg,
> +				     sctp_cmd_seq_t *commands);
> +
>  /* Small helper function that checks if the chunk length
>   * is of the appropriate length.  The 'required_length' argument
>   * is set to be the size of a specific chunk we are testing.
> @@ -2880,6 +2887,13 @@ sctp_disposition_t sctp_sf_eat_sack_6_2(
>  		return SCTP_DISPOSITION_DISCARD;
>  	}
>  
> +	/* If Cumulative TSN Ack beyond the max tsn currently
> +	 * send, terminating the association and respond to the 
> +	 * sender with an ABORT.
> +	 */
> +	if (!TSN_lt(ctsn, asoc->next_tsn))
> +		return sctp_sf_violation_ctsn(ep, asoc, type, arg, commands);
> +
>  	/* Return this SACK for further processing.  */
>  	sctp_add_cmd_sf(commands, SCTP_CMD_PROCESS_SACK, SCTP_SACKH(sackh));
>  
> @@ -3756,6 +3770,68 @@ nomem:
>  	return SCTP_DISPOSITION_NOMEM;
>  }
>  
> +/*
> + * Handle a protocol violation when the peer trying to advance the 
> + * cumulative tsn ack to a point beyond the max tsn currently sent.
> + *
> + * We inform the other end by sending an ABORT with a Protocol Violation
> + * error code.
> + *
> + * Section: Not specified
> + * Verification Tag:  Nothing to do
> + * Inputs
> + * (endpoint, asoc, chunk)
> + *
> + * Outputs
> + * (reply_msg, msg_up, counters)
> + *
> + * Generate an  ABORT chunk and terminate the association.
> + */
> +static sctp_disposition_t sctp_sf_violation_ctsn(
> +				     const struct sctp_endpoint *ep,
> +				     const struct sctp_association *asoc,
> +				     const sctp_subtype_t type,
> +				     void *arg,
> +				     sctp_cmd_seq_t *commands)
> +{
> +	struct sctp_chunk *chunk =  arg;
> +	struct sctp_chunk *abort = NULL;
> +	char err_str[] = "The cumulative tsn ack beyond the max tsn currently sent:";
> +
> +	/* Make the abort chunk. */
> +	abort = sctp_make_abort_violation(asoc, chunk, err_str,
> +					  sizeof(err_str));
> +	if (!abort)
> +		goto nomem;
> +
> +	sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(abort));
> +	SCTP_INC_STATS(SCTP_MIB_OUTCTRLCHUNKS);
> +
> +	if (asoc->state <= SCTP_STATE_COOKIE_ECHOED) {
> +		sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_STOP,
> +				SCTP_TO(SCTP_EVENT_TIMEOUT_T1_INIT));
> +		sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR,
> +				SCTP_ERROR(ECONNREFUSED));
> +		sctp_add_cmd_sf(commands, SCTP_CMD_INIT_FAILED,
> +				SCTP_PERR(SCTP_ERROR_PROTO_VIOLATION));
> +	} else {
> +		sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR,
> +				SCTP_ERROR(ECONNABORTED));
> +		sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED,
> +				SCTP_PERR(SCTP_ERROR_PROTO_VIOLATION));
> +		SCTP_DEC_STATS(SCTP_MIB_CURRESTAB);
> +	}
> +
> +	sctp_add_cmd_sf(commands, SCTP_CMD_DISCARD_PACKET, SCTP_NULL());
> +
> +	SCTP_INC_STATS(SCTP_MIB_ABORTEDS);
> +
> +	return SCTP_DISPOSITION_ABORT;
> +
> +nomem:
> +	return SCTP_DISPOSITION_NOMEM;
> +}
> +
>  /***************************************************************************
>   * These are the state functions for handling primitive (Section 10) events.
>   ***************************************************************************/
> 
> 
> 


^ permalink raw reply

* [NET][JANITOR] Add const string const-goodness to net/* and include/net/*
From: Mika Kukkonen @ 2007-08-01 12:34 UTC (permalink / raw)
  To: davem; +Cc: netdev

Compiling with "EXTRA_CFLAGS=-Wwrite-strings" reveals several places where
plain "char *" can be changed to "const char *". This patch does these
trivial and no-funtionality-changed changes to net/* and include/net/*.

Sadly this did not result in any savings in .text (tested by
building with allyesconfig and doing 'size -A net/builtin.o'):

$ diff before after
3c3
< .text                      2109288      0
---
> .text                      2109292      0
37c37
< .debug_info               47540379      0
---
> .debug_info               47540404      0
39c39
< .debug_line                2054813      0
---
> .debug_line                2054818      0
42c42
< .debug_loc                 2204455      0
---
> .debug_loc                 2204469      0
45c45
< Total                     78311758
---
> Total                     78311806

I'll let the others to decide, whether the additional
checking provided by the "const" makes sense...

Signed-off-by: Mika Kukkonen <mikukkon@iki.fi>

---

 include/linux/netfilter.h                      |    4 ++--
 include/linux/netfilter/x_tables.h             |    4 ++--
 include/linux/sunrpc/auth.h                    |    2 +-
 include/linux/sunrpc/cache.h                   |    2 +-
 include/linux/sunrpc/clnt.h                    |   10 ++++-----
 include/linux/sunrpc/gss_api.h                 |    4 ++--
 include/linux/sunrpc/gss_krb5.h                |    2 +-
 include/linux/sunrpc/svcauth.h                 |    4 ++--
 include/linux/sunrpc/xprt.h                    |    2 +-
 include/net/9p/9p.h                            |    2 +-
 include/net/act_api.h                          |    2 +-
 include/net/ax25.h                             |    2 +-
 include/net/bluetooth/hci_core.h               |    4 ++--
 include/net/dn_dev.h                           |    2 +-
 include/net/ip_vs.h                            |    9 ++++----
 include/net/irda/ircomm_event.h                |    2 +-
 include/net/irda/ircomm_tty_attach.h           |    3 +--
 include/net/irda/iriap.h                       |    2 +-
 include/net/irda/irias_object.h                |   27 ++++++++++++------------
 include/net/irda/irlan_common.h                |   13 +++++++-----
 include/net/irda/irlan_event.h                 |    2 +-
 include/net/irda/parameters.h                  |    2 +-
 include/net/iw_handler.h                       |    4 ++--
 include/net/neighbour.h                        |    4 ++--
 include/net/sctp/structs.h                     |    2 +-
 include/net/snmp.h                             |    2 +-
 include/net/tcp.h                              |    2 +-
 include/net/tipc/tipc_bearer.h                 |    2 +-
 include/net/udp.h                              |    2 +-
 include/net/xfrm.h                             |    8 ++++---
 net/9p/conv.c                                  |    4 ++--
 net/9p/error.c                                 |    2 +-
 net/atm/lec.c                                  |    4 ++--
 net/atm/proc.c                                 |    2 +-
 net/ax25/ax25_addr.c                           |    2 +-
 net/bluetooth/cmtp/capi.c                      |    2 +-
 net/bluetooth/hci_sysfs.c                      |    2 +-
 net/bridge/br_stp_if.c                         |    4 ++--
 net/core/dev.c                                 |    4 ++--
 net/core/neighbour.c                           |    2 +-
 net/dccp/ccids/ccid3.c                         |    4 ++--
 net/dccp/proto.c                               |    2 +-
 net/decnet/af_decnet.c                         |    2 +-
 net/decnet/dn_dev.c                            |    2 +-
 net/decnet/dn_nsp_in.c                         |    2 +-
 net/decnet/dn_route.c                          |    2 +-
 net/ieee80211/softmac/ieee80211softmac_event.c |    4 ++--
 net/ipv4/arp.c                                 |    2 +-
 net/ipv4/devinet.c                             |    2 +-
 net/ipv4/igmp.c                                |    2 +-
 net/ipv4/ipvs/ip_vs_proto.c                    |    2 +-
 net/ipv4/ipvs/ip_vs_proto_tcp.c                |    2 +-
 net/ipv4/ipvs/ip_vs_proto_udp.c                |    2 +-
 net/ipv4/netfilter/nf_nat_snmp_basic.c         |    2 +-
 net/ipv6/addrconf.c                            |    2 +-
 net/ipx/af_ipx.c                               |    2 +-
 net/irda/af_irda.c                             |    2 +-
 net/irda/ircomm/ircomm_event.c                 |    4 ++--
 net/irda/ircomm/ircomm_tty_attach.c            |    4 ++--
 net/irda/iriap.c                               |    2 +-
 net/irda/irias_object.c                        |   23 +++++++++++---------
 net/irda/irlan/irlan_common.c                  |   23 +++++++++++---------
 net/irda/irlan/irlan_event.c                   |    2 +-
 net/irda/irlap.c                               |    2 +-
 net/irda/irnet/irnet_irda.c                    |    2 +-
 net/irda/parameters.c                          |   10 ++++-----
 net/llc/llc_proc.c                             |    2 +-
 net/mac80211/debugfs_key.c                     |    2 +-
 net/netfilter/nf_conntrack_amanda.c            |    2 +-
 net/rose/rose_subr.c                           |    2 +-
 net/sched/act_api.c                            |    3 ++-
 net/sctp/socket.c                              |    2 +-
 net/sunrpc/auth_gss/gss_krb5_crypto.c          |    4 ++--
 net/sunrpc/auth_gss/gss_krb5_mech.c            |    2 +-
 net/sunrpc/auth_gss/gss_mech_switch.c          |    4 ++--
 net/sunrpc/auth_gss/gss_spkm3_seal.c           |    2 +-
 net/sunrpc/clnt.c                              |    4 ++--
 net/sunrpc/rpc_pipe.c                          |    2 +-
 net/sunrpc/rpcb_clnt.c                         |    9 ++++----
 net/sunrpc/svcauth_unix.c                      |    6 +++--
 net/sunrpc/xprtsock.c                          |    4 ++--
 net/tipc/bearer.c                              |    2 +-
 net/tipc/config.c                              |    4 ++--
 net/tipc/config.h                              |    8 ++++---
 net/tipc/dbg.c                                 |    2 +-
 net/tipc/link.c                                |    2 +-
 net/tipc/name_table.c                          |    2 +-
 net/wireless/wext.c                            |    2 +-
 88 files changed, 175 insertions(+), 167 deletions(-)

diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
index 0eed0b7..fcd455d 100644
--- a/include/linux/netfilter.h
+++ b/include/linux/netfilter.h
@@ -167,7 +167,7 @@ typedef void nf_logfn(unsigned int pf,
 struct nf_logger {
 	struct module	*me;
 	nf_logfn 	*logfn;
-	char		*name;
+	const char	*name;
 };
 
 /* Function to register/unregister log function. */
@@ -271,7 +271,7 @@ struct nf_queue_handler {
 	int (*outfn)(struct sk_buff *skb, struct nf_info *info,
 		     unsigned int queuenum, void *data);
 	void *data;
-	char *name;
+	const char *name;
 };
 extern int nf_register_queue_handler(int pf, 
                                      struct nf_queue_handler *qh);
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h
index 64f425a..da72667 100644
--- a/include/linux/netfilter/x_tables.h
+++ b/include/linux/netfilter/x_tables.h
@@ -186,7 +186,7 @@ struct xt_target
 {
 	struct list_head list;
 
-	const char name[XT_FUNCTION_MAXNAMELEN-1];
+	const char const name[XT_FUNCTION_MAXNAMELEN-1];
 
 	/* Returns verdict. Argument order changed since 2.6.9, as this
 	   must now handle non-linear skbs, using skb_copy_bits and
@@ -218,7 +218,7 @@ struct xt_target
 	/* Set this to THIS_MODULE if you are a module, otherwise NULL */
 	struct module *me;
 
-	char *table;
+	const char *table;
 	unsigned int targetsize;
 	unsigned int compatsize;
 	unsigned int hooks;
diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h
index 7a69ca3..793cc2f 100644
--- a/include/linux/sunrpc/auth.h
+++ b/include/linux/sunrpc/auth.h
@@ -98,7 +98,7 @@ struct rpc_authops {
 	struct module		*owner;
 	rpc_authflavor_t	au_flavor;	/* flavor (RPC_AUTH_*) */
 #ifdef RPC_DEBUG
-	char *			au_name;
+	const char *		au_name;
 #endif
 	struct rpc_auth *	(*create)(struct rpc_clnt *, rpc_authflavor_t);
 	void			(*destroy)(struct rpc_auth *);
diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h
index 3699dff..6dd9867 100644
--- a/include/linux/sunrpc/cache.h
+++ b/include/linux/sunrpc/cache.h
@@ -67,7 +67,7 @@ struct cache_detail {
 
 	atomic_t		inuse; /* active user-space update or lookup */
 
-	char			*name;
+	const char		*name;
 	void			(*cache_put)(struct kref *);
 
 	void			(*cache_request)(struct cache_detail *cd,
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h
index c0d9d14..653e6e9 100644
--- a/include/linux/sunrpc/clnt.h
+++ b/include/linux/sunrpc/clnt.h
@@ -35,7 +35,7 @@ struct rpc_clnt {
 				cl_maxproc;	/* max procedure number */
 
 	char *			cl_server;	/* server machine name */
-	char *			cl_protname;	/* protocol name */
+	const char *		cl_protname;	/* protocol name */
 	struct rpc_auth *	cl_auth;	/* authenticator */
 	struct rpc_stat *	cl_stats;	/* per-program statistics */
 	struct rpc_iostats *	cl_metrics;	/* per-client statistics */
@@ -63,7 +63,7 @@ struct rpc_clnt {
  */
 #define RPC_MAXVERSION		4
 struct rpc_program {
-	char *			name;		/* protocol name */
+	const char *		name;		/* protocol name */
 	u32			number;		/* program number */
 	unsigned int		nrvers;		/* number of versions */
 	struct rpc_version **	version;	/* version array */
@@ -89,7 +89,7 @@ struct rpc_procinfo {
 	unsigned int		p_count;	/* call count */
 	unsigned int		p_timer;	/* Which RTT timer to use */
 	u32			p_statidx;	/* Which procedure to account */
-	char *			p_name;		/* name of procedure */
+	const char *		p_name;		/* name of procedure */
 };
 
 #ifdef __KERNEL__
@@ -100,7 +100,7 @@ struct rpc_create_args {
 	size_t			addrsize;
 	struct sockaddr		*saddress;
 	struct rpc_timeout	*timeout;
-	char			*servername;
+	const char		*servername;
 	struct rpc_program	*program;
 	u32			version;
 	rpc_authflavor_t	authflavor;
@@ -142,7 +142,7 @@ void		rpc_setbufsize(struct rpc_clnt *, unsigned int, unsigned int);
 size_t		rpc_max_payload(struct rpc_clnt *);
 void		rpc_force_rebind(struct rpc_clnt *);
 size_t		rpc_peeraddr(struct rpc_clnt *, struct sockaddr *, size_t);
-char *		rpc_peeraddr2str(struct rpc_clnt *, enum rpc_display_format_t);
+const char *	rpc_peeraddr2str(struct rpc_clnt *, enum rpc_display_format_t);
 
 #endif /* __KERNEL__ */
 #endif /* _LINUX_SUNRPC_CLNT_H */
diff --git a/include/linux/sunrpc/gss_api.h b/include/linux/sunrpc/gss_api.h
index 459c5fc..638b571 100644
--- a/include/linux/sunrpc/gss_api.h
+++ b/include/linux/sunrpc/gss_api.h
@@ -65,7 +65,7 @@ char *gss_service_to_auth_domain_name(struct gss_api_mech *, u32 service);
 struct pf_desc {
 	u32	pseudoflavor;
 	u32	service;
-	char	*name;
+	const char *name;
 	char	*auth_domain_name;
 };
 
@@ -77,7 +77,7 @@ struct gss_api_mech {
 	struct list_head	gm_list;
 	struct module		*gm_owner;
 	struct xdr_netobj	gm_oid;
-	char			*gm_name;
+	const char		*gm_name;
 	const struct gss_api_ops *gm_ops;
 	/* pseudoflavors supported by this mechanism: */
 	int			gm_pf_num;
diff --git a/include/linux/sunrpc/gss_krb5.h b/include/linux/sunrpc/gss_krb5.h
index 5a4b1e0..b45aa0c 100644
--- a/include/linux/sunrpc/gss_krb5.h
+++ b/include/linux/sunrpc/gss_krb5.h
@@ -113,7 +113,7 @@ enum seal_alg {
 #define ENCTYPE_UNKNOWN         0x01ff
 
 s32
-make_checksum(char *, char *header, int hdrlen, struct xdr_buf *body,
+make_checksum(const char *, char *header, int hdrlen, struct xdr_buf *body,
 		   int body_offset, struct xdr_netobj *cksum);
 
 u32 gss_get_mic_kerberos(struct gss_ctx *, struct xdr_buf *,
diff --git a/include/linux/sunrpc/svcauth.h b/include/linux/sunrpc/svcauth.h
index 22e1ef8..bffd339 100644
--- a/include/linux/sunrpc/svcauth.h
+++ b/include/linux/sunrpc/svcauth.h
@@ -92,7 +92,7 @@ struct auth_domain {
  *   an appropriate 'auth_domain' as the client.
  */
 struct auth_ops {
-	char *	name;
+	const char *name;
 	struct module *owner;
 	int	flavour;
 	int	(*accept)(struct svc_rqst *rq, __be32 *authp);
@@ -129,7 +129,7 @@ extern void svcauth_unix_purge(void);
 extern void svcauth_unix_info_release(void *);
 extern int svcauth_unix_set_client(struct svc_rqst *rqstp);
 
-static inline unsigned long hash_str(char *name, int bits)
+static inline unsigned long hash_str(const char *name, int bits)
 {
 	unsigned long hash = 0;
 	unsigned long l = 0;
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h
index d11cedd..c43d613 100644
--- a/include/linux/sunrpc/xprt.h
+++ b/include/linux/sunrpc/xprt.h
@@ -193,7 +193,7 @@ struct rpc_xprt {
 					bklog_u;	/* backlog queue utilization */
 	} stat;
 
-	char *			address_strings[RPC_DISPLAY_MAX];
+	const char *		address_strings[RPC_DISPLAY_MAX];
 };
 
 struct rpc_xprtsock_create {
diff --git a/include/net/9p/9p.h b/include/net/9p/9p.h
index 88884d3..24e6a48 100644
--- a/include/net/9p/9p.h
+++ b/include/net/9p/9p.h
@@ -380,7 +380,7 @@ int p9_deserialize_stat(void *buf, u32 buflen, struct p9_stat *stat,
 	int dotu);
 int p9_deserialize_fcall(void *buf, u32 buflen, struct p9_fcall *fc, int dotu);
 void p9_set_tag(struct p9_fcall *fc, u16 tag);
-struct p9_fcall *p9_create_tversion(u32 msize, char *version);
+struct p9_fcall *p9_create_tversion(u32 msize, const char *version);
 struct p9_fcall *p9_create_tattach(u32 fid, u32 afid, char *uname,
 	char *aname);
 struct p9_fcall *p9_create_tauth(u32 afid, char *uname, char *aname);
diff --git a/include/net/act_api.h b/include/net/act_api.h
index 68b4eaf..72a76b1 100644
--- a/include/net/act_api.h
+++ b/include/net/act_api.h
@@ -115,7 +115,7 @@ extern int tcf_unregister_action(struct tc_action_ops *a);
 extern void tcf_action_destroy(struct tc_action *a, int bind);
 extern int tcf_action_exec(struct sk_buff *skb, struct tc_action *a, struct tcf_result *res);
 extern struct tc_action *tcf_action_init(struct rtattr *rta, struct rtattr *est, char *n, int ovr, int bind, int *err);
-extern struct tc_action *tcf_action_init_1(struct rtattr *rta, struct rtattr *est, char *n, int ovr, int bind, int *err);
+extern struct tc_action *tcf_action_init_1(struct rtattr *rta, struct rtattr *est, const char *n, int ovr, int bind, int *err);
 extern int tcf_action_dump(struct sk_buff *skb, struct tc_action *a, int, int);
 extern int tcf_action_dump_old(struct sk_buff *skb, struct tc_action *a, int, int);
 extern int tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int, int);
diff --git a/include/net/ax25.h b/include/net/ax25.h
index 99a4e36..a5c5f47 100644
--- a/include/net/ax25.h
+++ b/include/net/ax25.h
@@ -285,7 +285,7 @@ extern struct sock *ax25_make_new(struct sock *, struct ax25_dev *);
 extern const ax25_address ax25_bcast;
 extern const ax25_address ax25_defaddr;
 extern const ax25_address null_ax25_address;
-extern char *ax2asc(char *buf, const ax25_address *);
+extern const char *ax2asc(char *buf, const ax25_address *);
 extern void asc2ax(ax25_address *addr, const char *callsign);
 extern int ax25cmp(const ax25_address *, const ax25_address *);
 extern int ax25digicmp(const ax25_digi *, const ax25_digi *);
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 8f67c8a..de36523 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -457,7 +457,7 @@ void hci_conn_del_sysfs(struct hci_conn *conn);
 
 /* ----- HCI protocols ----- */
 struct hci_proto {
-	char 		*name;
+	const char	*name;
 	unsigned int	id;
 	unsigned long	flags;
 
@@ -547,7 +547,7 @@ int hci_unregister_proto(struct hci_proto *hproto);
 struct hci_cb {
 	struct list_head list;
 
-	char *name;
+	const char *name;
 
 	void (*auth_cfm)	(struct hci_conn *conn, __u8 status);
 	void (*encrypt_cfm)	(struct hci_conn *conn, __u8 status, __u8 encrypt);
diff --git a/include/net/dn_dev.h b/include/net/dn_dev.h
index cee4682..9c12b8a 100644
--- a/include/net/dn_dev.h
+++ b/include/net/dn_dev.h
@@ -74,7 +74,7 @@ struct dn_dev_parms {
 	unsigned long t2;         /* Default value of t2                */
 	unsigned long t3;         /* Default value of t3                */
 	int priority;             /* Priority to be a router            */
-	char *name;               /* Name for sysctl                    */
+	const char *name;         /* Name for sysctl                    */
 	int ctl_name;             /* Index for sysctl                   */
 	int  (*up)(struct net_device *);
 	void (*down)(struct net_device *);
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index 672564e..93c7547 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -436,7 +436,7 @@ struct sk_buff;
 
 struct ip_vs_protocol {
 	struct ip_vs_protocol	*next;
-	char			*name;
+	const char		*name;
 	__u16			protocol;
 	int			dont_defrag;
 	atomic_t		appcnt;		/* counter of proto app incs */
@@ -617,7 +617,7 @@ struct ip_vs_dest {
  */
 struct ip_vs_scheduler {
 	struct list_head	n_list;		/* d-linked list head */
-	char			*name;		/* scheduler name */
+	const char		*name;		/* scheduler name */
 	atomic_t		refcnt;		/* reference counter */
 	struct module		*module;	/* THIS_MODULE/NULL */
 
@@ -641,7 +641,7 @@ struct ip_vs_app
 {
 	struct list_head	a_list;		/* member in app list */
 	int			type;		/* IP_VS_APP_TYPE_xxx */
-	char			*name;		/* application module name */
+	const char		*name;		/* application module name */
 	__u16			protocol;
 	struct module		*module;	/* THIS_MODULE/NULL */
 	struct list_head	incs_list;	/* list of incarnations */
@@ -848,7 +848,8 @@ extern void ip_vs_protocol_cleanup(void);
 extern void ip_vs_protocol_timeout_change(int flags);
 extern int *ip_vs_create_timeout_table(int *table, int size);
 extern int
-ip_vs_set_state_timeout(int *table, int num, char **names, char *name, int to);
+ip_vs_set_state_timeout(int *table, int num, const char **names,
+			char *name, int to);
 extern void
 ip_vs_tcpudp_debug_packet(struct ip_vs_protocol *pp, const struct sk_buff *skb,
 			  int offset, const char *msg);
diff --git a/include/net/irda/ircomm_event.h b/include/net/irda/ircomm_event.h
index c290447..df27171 100644
--- a/include/net/irda/ircomm_event.h
+++ b/include/net/irda/ircomm_event.h
@@ -74,7 +74,7 @@ struct ircomm_info {
 	struct qos_info *qos;
 };
 
-extern char *ircomm_state[];
+extern const char *ircomm_state[];
 
 struct ircomm_cb;   /* Forward decl. */
 
diff --git a/include/net/irda/ircomm_tty_attach.h b/include/net/irda/ircomm_tty_attach.h
index f91a569..1d58f7a 100644
--- a/include/net/irda/ircomm_tty_attach.h
+++ b/include/net/irda/ircomm_tty_attach.h
@@ -66,8 +66,7 @@ struct ircomm_tty_info {
         __u8      dlsap_sel;
 };
 
-extern char *ircomm_state[];
-extern char *ircomm_tty_state[];
+extern const char *ircomm_tty_state[];
 
 int ircomm_tty_do_event(struct ircomm_tty_cb *self, IRCOMM_TTY_EVENT event,
 			struct sk_buff *skb, struct ircomm_tty_info *info);
diff --git a/include/net/irda/iriap.h b/include/net/irda/iriap.h
index fcc8964..86cab5c 100644
--- a/include/net/irda/iriap.h
+++ b/include/net/irda/iriap.h
@@ -96,7 +96,7 @@ void iriap_close(struct iriap_cb *self);
 
 int iriap_getvaluebyclass_request(struct iriap_cb *self, 
 				  __u32 saddr, __u32 daddr,
-				  char *name, char *attr);
+				  const char *name, const char *attr);
 void iriap_connect_request(struct iriap_cb *self);
 void iriap_send_ack( struct iriap_cb *self);
 void iriap_call_indication(struct iriap_cb *self, struct sk_buff *skb);
diff --git a/include/net/irda/irias_object.h b/include/net/irda/irias_object.h
index 83f7808..b407239 100644
--- a/include/net/irda/irias_object.h
+++ b/include/net/irda/irias_object.h
@@ -62,7 +62,7 @@ struct ias_value {
 	/* Value */
 	union {
 		int integer;
-		char *string;
+		const char *string;
 		__u8 *oct_seq;
 	} t;
 };
@@ -74,29 +74,30 @@ struct ias_attrib {
 	irda_queue_t q; /* Must be first! */
 	int magic;
 
-        char *name;   	         /* Attribute name */
+	const char *name;	 /* Attribute name */
 	struct ias_value *value; /* Attribute value */
 };
 
-struct ias_object *irias_new_object(char *name, int id);
+struct ias_object *irias_new_object(const char *name, int id);
 void irias_insert_object(struct ias_object *obj);
 int  irias_delete_object(struct ias_object *obj);
 int  irias_delete_attrib(struct ias_object *obj, struct ias_attrib *attrib,
 			 int cleanobject);
 void __irias_delete_object(struct ias_object *obj);
 
-void irias_add_integer_attrib(struct ias_object *obj, char *name, int value,
-			      int user);
-void irias_add_string_attrib(struct ias_object *obj, char *name, char *value,
-			     int user);
-void irias_add_octseq_attrib(struct ias_object *obj, char *name, __u8 *octets,
-			     int len, int user);
-int irias_object_change_attribute(char *obj_name, char *attrib_name, 
+void irias_add_integer_attrib(struct ias_object *obj, const char *name,
+			      int value, int user);
+void irias_add_string_attrib(struct ias_object *obj, const char *name,
+			     const char *value, int user);
+void irias_add_octseq_attrib(struct ias_object *obj, const char *name,
+			     __u8 *octets, int len, int user);
+int irias_object_change_attribute(const char *obj_name,
+				  const char *attrib_name, 
 				  struct ias_value *new_value);
-struct ias_object *irias_find_object(char *name);
-struct ias_attrib *irias_find_attrib(struct ias_object *obj, char *name);
+struct ias_object *irias_find_object(const char *name);
+struct ias_attrib *irias_find_attrib(struct ias_object *obj, const char *name);
 
-struct ias_value *irias_new_string_value(char *string);
+struct ias_value *irias_new_string_value(const char *string);
 struct ias_value *irias_new_integer_value(int integer);
 struct ias_value *irias_new_octseq_value(__u8 *octseq , int len);
 struct ias_value *irias_new_missing_value(void);
diff --git a/include/net/irda/irlan_common.h b/include/net/irda/irlan_common.h
index 73cacb3..e06da60 100644
--- a/include/net/irda/irlan_common.h
+++ b/include/net/irda/irlan_common.h
@@ -217,11 +217,14 @@ void irlan_close_data_channel(struct irlan_cb *self);
 void irlan_set_multicast_filter(struct irlan_cb *self, int status);
 void irlan_set_broadcast_filter(struct irlan_cb *self, int status);
 
-int irlan_insert_byte_param(struct sk_buff *skb, char *param, __u8 value);
-int irlan_insert_short_param(struct sk_buff *skb, char *param, __u16 value);
-int irlan_insert_string_param(struct sk_buff *skb, char *param, char *value);
-int irlan_insert_array_param(struct sk_buff *skb, char *name, __u8 *value, 
-			     __u16 value_len);
+int irlan_insert_byte_param(struct sk_buff *skb,
+			    const char *param, __u8 value);
+int irlan_insert_short_param(struct sk_buff *skb,
+			     const char *param, __u16 value);
+int irlan_insert_string_param(struct sk_buff *skb,
+			      const char *param, const char *value);
+int irlan_insert_array_param(struct sk_buff *skb, const char *name,
+			     __u8 *value, __u16 value_len);
 
 int irlan_extract_param(__u8 *buf, char *name, char *value, __u16 *len);
 
diff --git a/include/net/irda/irlan_event.h b/include/net/irda/irlan_event.h
index 6d9539f..75fe8fc 100644
--- a/include/net/irda/irlan_event.h
+++ b/include/net/irda/irlan_event.h
@@ -67,7 +67,7 @@ typedef enum {
 	IRLAN_WATCHDOG_TIMEOUT,
 } IRLAN_EVENT;
 
-extern char *irlan_state[];
+extern const char *irlan_state[];
 
 void irlan_do_client_event(struct irlan_cb *self, IRLAN_EVENT event, 
 			   struct sk_buff *skb);
diff --git a/include/net/irda/parameters.h b/include/net/irda/parameters.h
index c0d9388..bd538b2 100644
--- a/include/net/irda/parameters.h
+++ b/include/net/irda/parameters.h
@@ -89,7 +89,7 @@ typedef struct {
 	int              pi_major_offset;
 } pi_param_info_t;
 
-int irda_param_pack(__u8 *buf, char *fmt, ...);
+int irda_param_pack(__u8 *buf, const char *fmt, ...);
 
 int irda_param_insert(void *self, __u8 pi, __u8 *buf, int len, 
 		      pi_param_info_t *info);
diff --git a/include/net/iw_handler.h b/include/net/iw_handler.h
index f23d07c..a5865fa 100644
--- a/include/net/iw_handler.h
+++ b/include/net/iw_handler.h
@@ -437,7 +437,7 @@ struct iw_public_data {
 extern void wireless_send_event(struct net_device *	dev,
 				unsigned int		cmd,
 				union iwreq_data *	wrqu,
-				char *			extra);
+				const char *		extra);
 
 /* We may need a function to send a stream of events to user space.
  * More on that later... */
@@ -504,7 +504,7 @@ static inline char *
 iwe_stream_add_point(char *	stream,		/* Stream of events */
 		     char *	ends,		/* End of stream */
 		     struct iw_event *iwe,	/* Payload length + flags */
-		     char *	extra)		/* More payload */
+		     const char *extra)		/* More payload */
 {
 	int	event_len = IW_EV_POINT_LEN + iwe->u.data.length;
 	/* Check if it's possible */
diff --git a/include/net/neighbour.h b/include/net/neighbour.h
index a4f2618..0c31675 100644
--- a/include/net/neighbour.h
+++ b/include/net/neighbour.h
@@ -147,7 +147,7 @@ struct neigh_table
 	int			(*pconstructor)(struct pneigh_entry *);
 	void			(*pdestructor)(struct pneigh_entry *);
 	void			(*proxy_redo)(struct sk_buff *skb);
-	char			*id;
+	const char		*id;
 	struct neigh_parms	parms;
 	/* HACK. gc_* shoul follow parms without a gap! */
 	int			gc_interval;
@@ -236,7 +236,7 @@ extern void neigh_seq_stop(struct seq_file *, void *);
 extern int			neigh_sysctl_register(struct net_device *dev, 
 						      struct neigh_parms *p,
 						      int p_id, int pdev_id,
-						      char *p_name,
+						      const char *p_name,
 						      proc_handler *proc_handler,
 						      ctl_handler *strategy);
 extern void			neigh_sysctl_unregister(struct neigh_parms *p);
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index ee4559b..a9cd773 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -1878,7 +1878,7 @@ typedef struct sctp_cmsgs {
 
 /* Structure for tracking memory objects */
 typedef struct {
-	char *label;
+	const char *label;
 	atomic_t *counter;
 } sctp_dbg_objcnt_entry_t;
 
diff --git a/include/net/snmp.h b/include/net/snmp.h
index 464970e..ff3f4b8 100644
--- a/include/net/snmp.h
+++ b/include/net/snmp.h
@@ -33,7 +33,7 @@
  *  - name of entries.
  */
 struct snmp_mib {
-	char *name;
+	const char *name;
 	int entry;
 };
 
diff --git a/include/net/tcp.h b/include/net/tcp.h
index c209361..b8d5c94 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -1286,7 +1286,7 @@ enum tcp_seq_states {
 
 struct tcp_seq_afinfo {
 	struct module		*owner;
-	char			*name;
+	const char		*name;
 	sa_family_t		family;
 	int			(*seq_show) (struct seq_file *m, void *v);
 	struct file_operations	*seq_fops;
diff --git a/include/net/tipc/tipc_bearer.h b/include/net/tipc/tipc_bearer.h
index 2151a80..6242557 100644
--- a/include/net/tipc/tipc_bearer.h
+++ b/include/net/tipc/tipc_bearer.h
@@ -101,7 +101,7 @@ struct tipc_bearer {
 
 
 int  tipc_register_media(u32 media_type,
-			 char *media_name, 
+			 const char *media_name, 
 			 int (*enable)(struct tipc_bearer *), 
 			 void (*disable)(struct tipc_bearer *), 
 			 int (*send_msg)(struct sk_buff *, 
diff --git a/include/net/udp.h b/include/net/udp.h
index 98755eb..10e6e53 100644
--- a/include/net/udp.h
+++ b/include/net/udp.h
@@ -152,7 +152,7 @@ DECLARE_SNMP_STAT(struct udp_mib, udp_statistics);
 /* /proc */
 struct udp_seq_afinfo {
 	struct module		*owner;
-	char			*name;
+	const char		*name;
 	sa_family_t		family;
 	struct hlist_head	*hashtable;
 	int 			(*seq_show) (struct seq_file *m, void *v);
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index a5f80bf..61c928b 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -273,7 +273,7 @@ extern void xfrm_state_delete_tunnel(struct xfrm_state *x);
 
 struct xfrm_type
 {
-	char			*description;
+	const char		*description;
 	struct module		*owner;
 	__u8			proto;
 	__u8			flags;
@@ -403,7 +403,7 @@ struct xfrm_migrate {
 struct xfrm_mgr
 {
 	struct list_head	list;
-	char			*id;
+	const char		*id;
 	int			(*notify)(struct xfrm_state *x, struct km_event *c);
 	int			(*acquire)(struct xfrm_state *x, struct xfrm_tmpl *, struct xfrm_policy *xp, int dir);
 	struct xfrm_policy	*(*compile_policy)(struct sock *sk, int opt, u8 *data, int len, int *dir);
@@ -884,8 +884,8 @@ struct xfrm_algo_comp_info {
 };
 
 struct xfrm_algo_desc {
-	char *name;
-	char *compat;
+	const char *name;
+	const char *compat;
 	u8 available:1;
 	union {
 		struct xfrm_algo_auth_info auth;
diff --git a/net/9p/conv.c b/net/9p/conv.c
index f2a041c..cfec713 100644
--- a/net/9p/conv.c
+++ b/net/9p/conv.c
@@ -434,7 +434,7 @@ static inline void p9_put_int64(struct cbuf *bufp, u64 val, u64 * p)
 }
 
 static void
-p9_put_str(struct cbuf *bufp, char *data, struct p9_str *str)
+p9_put_str(struct cbuf *bufp, const char *data, struct p9_str *str)
 {
 	int len;
 	char *s;
@@ -523,7 +523,7 @@ void p9_set_tag(struct p9_fcall *fc, u16 tag)
 }
 EXPORT_SYMBOL(p9_set_tag);
 
-struct p9_fcall *p9_create_tversion(u32 msize, char *version)
+struct p9_fcall *p9_create_tversion(u32 msize, const char *version)
 {
 	int size;
 	struct p9_fcall *fc;
diff --git a/net/9p/error.c b/net/9p/error.c
index ab2458b..5483a99 100644
--- a/net/9p/error.c
+++ b/net/9p/error.c
@@ -34,7 +34,7 @@
 #include <net/9p/9p.h>
 
 struct errormap {
-	char *name;
+	const char *name;
 	int val;
 
 	int namelen;
diff --git a/net/atm/lec.c b/net/atm/lec.c
index 2770fb4..a67bdb3 100644
--- a/net/atm/lec.c
+++ b/net/atm/lec.c
@@ -972,9 +972,9 @@ static int lecd_attach(struct atm_vcc *vcc, int arg)
 }
 
 #ifdef CONFIG_PROC_FS
-static char *lec_arp_get_status_string(unsigned char status)
+static const char *lec_arp_get_status_string(unsigned char status)
 {
-	static char *lec_arp_status_string[] = {
+	static const char *lec_arp_status_string[] = {
 		"ESI_UNKNOWN       ",
 		"ESI_ARP_PENDING   ",
 		"ESI_VC_PENDING    ",
diff --git a/net/atm/proc.c b/net/atm/proc.c
index 99fc1fe..d8b429d 100644
--- a/net/atm/proc.c
+++ b/net/atm/proc.c
@@ -456,7 +456,7 @@ void atm_proc_dev_deregister(struct atm_dev *dev)
 }
 
 static struct atm_proc_entry {
-	char *name;
+	const char *name;
 	const struct file_operations *proc_fops;
 	struct proc_dir_entry *dirent;
 } atm_proc_ents[] = {
diff --git a/net/ax25/ax25_addr.c b/net/ax25/ax25_addr.c
index 7e7964d..b9a0f8c 100644
--- a/net/ax25/ax25_addr.c
+++ b/net/ax25/ax25_addr.c
@@ -47,7 +47,7 @@ EXPORT_SYMBOL(null_ax25_address);
 /*
  *	ax25 -> ascii conversion
  */
-char *ax2asc(char *buf, const ax25_address *a)
+const char *ax2asc(char *buf, const ax25_address *a)
 {
 	char c, *s;
 	int n;
diff --git a/net/bluetooth/cmtp/capi.c b/net/bluetooth/cmtp/capi.c
index 3e9d5bb..f76c791 100644
--- a/net/bluetooth/cmtp/capi.c
+++ b/net/bluetooth/cmtp/capi.c
@@ -516,7 +516,7 @@ static u16 cmtp_send_message(struct capi_ctr *ctrl, struct sk_buff *skb)
 	return CAPI_NOERROR;
 }
 
-static char *cmtp_procinfo(struct capi_ctr *ctrl)
+static const char *cmtp_procinfo(struct capi_ctr *ctrl)
 {
 	return "CAPI Message Transport Protocol";
 }
diff --git a/net/bluetooth/hci_sysfs.c b/net/bluetooth/hci_sysfs.c
index 2583540..eb93bfc 100644
--- a/net/bluetooth/hci_sysfs.c
+++ b/net/bluetooth/hci_sysfs.c
@@ -13,7 +13,7 @@
 #define BT_DBG(D...)
 #endif
 
-static inline char *typetostr(int type)
+static inline const char *typetostr(int type)
 {
 	switch (type) {
 	case HCI_VIRTUAL:
diff --git a/net/bridge/br_stp_if.c b/net/bridge/br_stp_if.c
index 1ea2f86..4d578e7 100644
--- a/net/bridge/br_stp_if.c
+++ b/net/bridge/br_stp_if.c
@@ -122,7 +122,7 @@ void br_stp_disable_port(struct net_bridge_port *p)
 static void br_stp_start(struct net_bridge *br)
 {
 	int r;
-	char *argv[] = { BR_STP_PROG, br->dev->name, "start", NULL };
+	const char *argv[] = { BR_STP_PROG, br->dev->name, "start", NULL };
 	char *envp[] = { NULL };
 
 	r = call_usermodehelper(BR_STP_PROG, argv, envp, UMH_WAIT_PROC);
@@ -144,7 +144,7 @@ static void br_stp_start(struct net_bridge *br)
 static void br_stp_stop(struct net_bridge *br)
 {
 	int r;
-	char *argv[] = { BR_STP_PROG, br->dev->name, "stop", NULL };
+	const char *argv[] = { BR_STP_PROG, br->dev->name, "stop", NULL };
 	char *envp[] = { NULL };
 
 	if (br->stp_enabled == BR_USER_STP) {
diff --git a/net/core/dev.c b/net/core/dev.c
index 6cc8a70..cf167ab 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2458,14 +2458,14 @@ static void ptype_seq_decode(struct seq_file *seq, void *sym)
 #ifdef CONFIG_KALLSYMS
 	unsigned long offset = 0, symsize;
 	const char *symname;
-	char *modname;
+	const char *modname;
 	char namebuf[128];
 
 	symname = kallsyms_lookup((unsigned long)sym, &symsize, &offset,
 				  &modname, namebuf);
 
 	if (symname) {
-		char *delim = ":";
+		const char *delim = ":";
 
 		if (!modname)
 			modname = delim = "";
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index ca2a153..6977937 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -2637,7 +2637,7 @@ static struct neigh_sysctl_table {
 };
 
 int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p,
-			  int p_id, int pdev_id, char *p_name,
+			  int p_id, int pdev_id, const char *p_name,
 			  proc_handler *handler, ctl_handler *strategy)
 {
 	struct neigh_sysctl_table *t = kmemdup(&neigh_sysctl_template,
diff --git a/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c
index e91c2b9..60c25ec 100644
--- a/net/dccp/ccids/ccid3.c
+++ b/net/dccp/ccids/ccid3.c
@@ -56,7 +56,7 @@ static struct dccp_rx_hist *ccid3_rx_hist;
 #ifdef CONFIG_IP_DCCP_CCID3_DEBUG
 static const char *ccid3_tx_state_name(enum ccid3_hc_tx_states state)
 {
-	static char *ccid3_state_names[] = {
+	static const char *ccid3_state_names[] = {
 	[TFRC_SSTATE_NO_SENT]  = "NO_SENT",
 	[TFRC_SSTATE_NO_FBACK] = "NO_FBACK",
 	[TFRC_SSTATE_FBACK]    = "FBACK",
@@ -692,7 +692,7 @@ static int ccid3_hc_tx_getsockopt(struct sock *sk, const int optname, int len,
 #ifdef CONFIG_IP_DCCP_CCID3_DEBUG
 static const char *ccid3_rx_state_name(enum ccid3_hc_rx_states state)
 {
-	static char *ccid3_rx_state_names[] = {
+	static const char *ccid3_rx_state_names[] = {
 	[TFRC_RSTATE_NO_DATA] = "NO_DATA",
 	[TFRC_RSTATE_DATA]    = "DATA",
 	[TFRC_RSTATE_TERM]    = "TERM",
diff --git a/net/dccp/proto.c b/net/dccp/proto.c
index 04b59ec..644922f 100644
--- a/net/dccp/proto.c
+++ b/net/dccp/proto.c
@@ -132,7 +132,7 @@ EXPORT_SYMBOL_GPL(dccp_packet_name);
 
 const char *dccp_state_name(const int state)
 {
-	static char *dccp_state_names[] = {
+	static const char *dccp_state_names[] = {
 	[DCCP_OPEN]	  = "OPEN",
 	[DCCP_REQUESTING] = "REQUESTING",
 	[DCCP_PARTOPEN]	  = "PARTOPEN",
diff --git a/net/decnet/af_decnet.c b/net/decnet/af_decnet.c
index ed76d4a..da1d4e6 100644
--- a/net/decnet/af_decnet.c
+++ b/net/decnet/af_decnet.c
@@ -2220,7 +2220,7 @@ static void dn_printable_object(struct sockaddr_dn *dn, unsigned char *buf)
 	}
 }
 
-static char *dn_state2asc(unsigned char state)
+static const char *dn_state2asc(unsigned char state)
 {
 	switch(state) {
 		case DN_O:
diff --git a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c
index fa6604f..cbe8976 100644
--- a/net/decnet/dn_dev.c
+++ b/net/decnet/dn_dev.c
@@ -1377,7 +1377,7 @@ static void dn_dev_seq_stop(struct seq_file *seq, void *v)
 	read_unlock(&dev_base_lock);
 }
 
-static char *dn_type2asc(char type)
+static const char *dn_type2asc(char type)
 {
 	switch(type) {
 		case DN_DEV_BCAST:
diff --git a/net/decnet/dn_nsp_in.c b/net/decnet/dn_nsp_in.c
index 4074a6e..2dc4cf9 100644
--- a/net/decnet/dn_nsp_in.c
+++ b/net/decnet/dn_nsp_in.c
@@ -81,7 +81,7 @@ extern int decnet_log_martians;
 static void dn_log_martian(struct sk_buff *skb, const char *msg)
 {
 	if (decnet_log_martians && net_ratelimit()) {
-		char *devname = skb->dev ? skb->dev->name : "???";
+		const char *devname = skb->dev ? skb->dev->name : "???";
 		struct dn_skb_cb *cb = DN_SKB_CB(skb);
 		printk(KERN_INFO "DECnet: Martian packet (%s) dev=%s src=0x%04hx dst=0x%04hx srcport=0x%04hx dstport=0x%04hx\n", msg, devname, dn_ntohs(cb->src), dn_ntohs(cb->dst), dn_ntohs(cb->src_port), dn_ntohs(cb->dst_port));
 	}
diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c
index a4a6209..b4774af 100644
--- a/net/decnet/dn_route.c
+++ b/net/decnet/dn_route.c
@@ -474,7 +474,7 @@ static int dn_route_rx_packet(struct sk_buff *skb)
 		return dst_input(skb);
 
 	if (decnet_debug_level & 4) {
-		char *devname = skb->dev ? skb->dev->name : "???";
+		const char *devname = skb->dev ? skb->dev->name : "???";
 		struct dn_skb_cb *cb = DN_SKB_CB(skb);
 		printk(KERN_DEBUG
 			"DECnet: dn_route_rx_packet: rt_flags=0x%02x dev=%s len=%d src=0x%04hx dst=0x%04hx err=%d type=%d\n",
diff --git a/net/ieee80211/softmac/ieee80211softmac_event.c b/net/ieee80211/softmac/ieee80211softmac_event.c
index b3e33a4..4026ec1 100644
--- a/net/ieee80211/softmac/ieee80211softmac_event.c
+++ b/net/ieee80211/softmac/ieee80211softmac_event.c
@@ -59,7 +59,7 @@
  * whenever the event context matches.
  */
 
-static char *event_descriptions[IEEE80211SOFTMAC_EVENT_LAST+1] = {
+static const char *event_descriptions[IEEE80211SOFTMAC_EVENT_LAST+1] = {
 	NULL, /* scan finished */
 	NULL, /* associated */
 	"associating failed",
@@ -137,7 +137,7 @@ ieee80211softmac_call_events_locked(struct ieee80211softmac_device *mac, int eve
 	if (event >= 0) {
 		union iwreq_data wrqu;
 		int we_event;
-		char *msg = NULL;
+		const char *msg = NULL;
 
 		memset(&wrqu, '\0', sizeof (union iwreq_data));
 
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index 9ab9d53..c8a18c3 100644
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -1258,7 +1258,7 @@ void __init arp_init(void)
 /*
  *	ax25 -> ASCII conversion
  */
-static char *ax2asc2(ax25_address *a, char *buf)
+static const char *ax2asc2(ax25_address *a, char *buf)
 {
 	char c, *s;
 	int n;
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index 5b77bda..238da8a 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -1496,7 +1496,7 @@ static void devinet_sysctl_register(struct in_device *in_dev,
 	struct net_device *dev = in_dev ? in_dev->dev : NULL;
 	struct devinet_sysctl_table *t = kmemdup(&devinet_sysctl, sizeof(*t),
 						 GFP_KERNEL);
-	char *dev_name = NULL;
+	const char *dev_name = NULL;
 
 	if (!t)
 		return;
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index a646409..a496db3 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -2377,7 +2377,7 @@ static int igmp_mc_seq_show(struct seq_file *seq, void *v)
 	else {
 		struct ip_mc_list *im = (struct ip_mc_list *)v;
 		struct igmp_mc_iter_state *state = igmp_mc_seq_private(seq);
-		char   *querier;
+		const char *querier;
 #ifdef CONFIG_IP_MULTICAST
 		querier = IGMP_V1_SEEN(state->in_dev) ? "V1" :
 			  IGMP_V2_SEEN(state->in_dev) ? "V2" :
diff --git a/net/ipv4/ipvs/ip_vs_proto.c b/net/ipv4/ipvs/ip_vs_proto.c
index e844ddb..fc40def 100644
--- a/net/ipv4/ipvs/ip_vs_proto.c
+++ b/net/ipv4/ipvs/ip_vs_proto.c
@@ -126,7 +126,7 @@ ip_vs_create_timeout_table(int *table, int size)
  *	Set timeout value for state specified by name
  */
 int
-ip_vs_set_state_timeout(int *table, int num, char **names, char *name, int to)
+ip_vs_set_state_timeout(int *table, int num, const char **names, char *name, int to)
 {
 	int i;
 
diff --git a/net/ipv4/ipvs/ip_vs_proto_tcp.c b/net/ipv4/ipvs/ip_vs_proto_tcp.c
index e65577a..6ddb0f2 100644
--- a/net/ipv4/ipvs/ip_vs_proto_tcp.c
+++ b/net/ipv4/ipvs/ip_vs_proto_tcp.c
@@ -274,7 +274,7 @@ static int tcp_timeouts[IP_VS_TCP_S_LAST+1] = {
 	[IP_VS_TCP_S_LAST]		=	2*HZ,
 };
 
-static char * tcp_state_name_table[IP_VS_TCP_S_LAST+1] = {
+static const char * tcp_state_name_table[IP_VS_TCP_S_LAST+1] = {
 	[IP_VS_TCP_S_NONE]		=	"NONE",
 	[IP_VS_TCP_S_ESTABLISHED]	=	"ESTABLISHED",
 	[IP_VS_TCP_S_SYN_SENT]		=	"SYN_SENT",
diff --git a/net/ipv4/ipvs/ip_vs_proto_udp.c b/net/ipv4/ipvs/ip_vs_proto_udp.c
index 8ee5fe6..ecf8c40 100644
--- a/net/ipv4/ipvs/ip_vs_proto_udp.c
+++ b/net/ipv4/ipvs/ip_vs_proto_udp.c
@@ -369,7 +369,7 @@ static int udp_timeouts[IP_VS_UDP_S_LAST+1] = {
 	[IP_VS_UDP_S_LAST]		=	2*HZ,
 };
 
-static char * udp_state_name_table[IP_VS_UDP_S_LAST+1] = {
+static const char * udp_state_name_table[IP_VS_UDP_S_LAST+1] = {
 	[IP_VS_UDP_S_NORMAL]		=	"UDP",
 	[IP_VS_UDP_S_LAST]		=	"BUG!",
 };
diff --git a/net/ipv4/netfilter/nf_nat_snmp_basic.c b/net/ipv4/netfilter/nf_nat_snmp_basic.c
index 6bfcd3a..af211ea 100644
--- a/net/ipv4/netfilter/nf_nat_snmp_basic.c
+++ b/net/ipv4/netfilter/nf_nat_snmp_basic.c
@@ -1079,7 +1079,7 @@ static int snmp_parse_mangle(unsigned char *msg,
 	if (cls != ASN1_CTX || con != ASN1_CON)
 		return 0;
 	if (debug > 1) {
-		unsigned char *pdus[] = {
+		const unsigned char *pdus[] = {
 			[SNMP_PDU_GET] = "get",
 			[SNMP_PDU_NEXT] = "get-next",
 			[SNMP_PDU_RESPONSE] = "response",
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 91ef3be..230a39d 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -4095,7 +4095,7 @@ static void addrconf_sysctl_register(struct inet6_dev *idev, struct ipv6_devconf
 	int i;
 	struct net_device *dev = idev ? idev->dev : NULL;
 	struct addrconf_sysctl_table *t;
-	char *dev_name = NULL;
+	const char *dev_name = NULL;
 
 	t = kmemdup(&addrconf_sysctl, sizeof(*t), GFP_KERNEL);
 	if (t == NULL)
diff --git a/net/ipx/af_ipx.c b/net/ipx/af_ipx.c
index 8400525..ca525c1 100644
--- a/net/ipx/af_ipx.c
+++ b/net/ipx/af_ipx.c
@@ -1277,7 +1277,7 @@ __be16 ipx_cksum(struct ipxhdr *packet, int length)
 
 const char *ipx_frame_name(__be16 frame)
 {
-	char* rc = "None";
+	const char* rc = "None";
 
 	switch (ntohs(frame)) {
 	case ETH_P_IPX:		rc = "EtherII";	break;
diff --git a/net/irda/af_irda.c b/net/irda/af_irda.c
index 4c670cf..50df118 100644
--- a/net/irda/af_irda.c
+++ b/net/irda/af_irda.c
@@ -538,7 +538,7 @@ static int irda_open_lsap(struct irda_sock *self, int pid)
  * Note that in some case, the query fail even before we go to sleep,
  * creating some races...
  */
-static int irda_find_lsap_sel(struct irda_sock *self, char *name)
+static int irda_find_lsap_sel(struct irda_sock *self, const char *name)
 {
 	IRDA_DEBUG(2, "%s(%p, %s)\n", __FUNCTION__, self, name);
 
diff --git a/net/irda/ircomm/ircomm_event.c b/net/irda/ircomm/ircomm_event.c
index 8ba4e59..5de6f56 100644
--- a/net/irda/ircomm/ircomm_event.c
+++ b/net/irda/ircomm/ircomm_event.c
@@ -49,7 +49,7 @@ static int ircomm_state_waitr(struct ircomm_cb *self, IRCOMM_EVENT event,
 static int ircomm_state_conn(struct ircomm_cb *self, IRCOMM_EVENT event,
 			     struct sk_buff *skb, struct ircomm_info *info);
 
-char *ircomm_state[] = {
+const char *ircomm_state[] = {
 	"IRCOMM_IDLE",
 	"IRCOMM_WAITI",
 	"IRCOMM_WAITR",
@@ -57,7 +57,7 @@ char *ircomm_state[] = {
 };
 
 #ifdef CONFIG_IRDA_DEBUG
-static char *ircomm_event[] = {
+static const char *ircomm_event[] = {
 	"IRCOMM_CONNECT_REQUEST",
 	"IRCOMM_CONNECT_RESPONSE",
 	"IRCOMM_TTP_CONNECT_INDICATION",
diff --git a/net/irda/ircomm/ircomm_tty_attach.c b/net/irda/ircomm/ircomm_tty_attach.c
index 824309d..d55b299 100644
--- a/net/irda/ircomm/ircomm_tty_attach.c
+++ b/net/irda/ircomm/ircomm_tty_attach.c
@@ -80,7 +80,7 @@ static int ircomm_tty_state_ready(struct ircomm_tty_cb *self,
 				  struct sk_buff *skb,
 				  struct ircomm_tty_info *info);
 
-char *ircomm_tty_state[] = {
+const char *ircomm_tty_state[] = {
 	"IRCOMM_TTY_IDLE",
 	"IRCOMM_TTY_SEARCH",
 	"IRCOMM_TTY_QUERY_PARAMETERS",
@@ -91,7 +91,7 @@ char *ircomm_tty_state[] = {
 };
 
 #ifdef CONFIG_IRDA_DEBUG
-static char *ircomm_tty_event[] = {
+static const char *ircomm_tty_event[] = {
 	"IRCOMM_TTY_ATTACH_CABLE",
 	"IRCOMM_TTY_DETACH_CABLE",
 	"IRCOMM_TTY_DATA_REQUEST",
diff --git a/net/irda/iriap.c b/net/irda/iriap.c
index ee3889f..f104da2 100644
--- a/net/irda/iriap.c
+++ b/net/irda/iriap.c
@@ -369,7 +369,7 @@ static void iriap_disconnect_request(struct iriap_cb *self)
  */
 int iriap_getvaluebyclass_request(struct iriap_cb *self,
 				  __u32 saddr, __u32 daddr,
-				  char *name, char *attr)
+				  const char *name, const char *attr)
 {
 	struct sk_buff *tx_skb;
 	int name_len, attr_len, skb_len;
diff --git a/net/irda/irias_object.c b/net/irda/irias_object.c
index cf30245..38b8709 100644
--- a/net/irda/irias_object.c
+++ b/net/irda/irias_object.c
@@ -43,7 +43,7 @@ struct ias_value irias_missing = { IAS_MISSING, 0, 0, 0, {0}};
  *    Create a new IAS object
  *
  */
-struct ias_object *irias_new_object( char *name, int id)
+struct ias_object *irias_new_object(const char *name, int id)
 {
 	struct ias_object *obj;
 
@@ -200,7 +200,7 @@ EXPORT_SYMBOL(irias_insert_object);
  *    Find object with given name
  *
  */
-struct ias_object *irias_find_object(char *name)
+struct ias_object *irias_find_object(const char *name)
 {
 	IRDA_ASSERT(name != NULL, return NULL;);
 
@@ -215,7 +215,7 @@ EXPORT_SYMBOL(irias_find_object);
  *    Find named attribute in object
  *
  */
-struct ias_attrib *irias_find_attrib(struct ias_object *obj, char *name)
+struct ias_attrib *irias_find_attrib(struct ias_object *obj, const char *name)
 {
 	struct ias_attrib *attrib;
 
@@ -258,7 +258,8 @@ static void irias_add_attrib(struct ias_object *obj, struct ias_attrib *attrib,
  *    Change the value of an objects attribute.
  *
  */
-int irias_object_change_attribute(char *obj_name, char *attrib_name,
+int irias_object_change_attribute(const char *obj_name,
+				  const char *attrib_name,
 				  struct ias_value *new_value)
 {
 	struct ias_object *obj;
@@ -310,8 +311,8 @@ EXPORT_SYMBOL(irias_object_change_attribute);
  *    Add an integer attribute to an LM-IAS object
  *
  */
-void irias_add_integer_attrib(struct ias_object *obj, char *name, int value,
-			      int owner)
+void irias_add_integer_attrib(struct ias_object *obj, const char *name,
+			      int value, int owner)
 {
 	struct ias_attrib *attrib;
 
@@ -352,8 +353,8 @@ EXPORT_SYMBOL(irias_add_integer_attrib);
  *
  */
 
-void irias_add_octseq_attrib(struct ias_object *obj, char *name, __u8 *octets,
-			     int len, int owner)
+void irias_add_octseq_attrib(struct ias_object *obj, const char *name,
+			     __u8 *octets, int len, int owner)
 {
 	struct ias_attrib *attrib;
 
@@ -394,8 +395,8 @@ EXPORT_SYMBOL(irias_add_octseq_attrib);
  *    Add a string attribute to an LM-IAS object
  *
  */
-void irias_add_string_attrib(struct ias_object *obj, char *name, char *value,
-			     int owner)
+void irias_add_string_attrib(struct ias_object *obj, const char *name,
+			     const char *value, int owner)
 {
 	struct ias_attrib *attrib;
 
@@ -461,7 +462,7 @@ EXPORT_SYMBOL(irias_new_integer_value);
  *
  * Per IrLMP 1.1, 4.3.3.2, strings are up to 256 chars - Jean II
  */
-struct ias_value *irias_new_string_value(char *string)
+struct ias_value *irias_new_string_value(const char *string)
 {
 	struct ias_value *value;
 
diff --git a/net/irda/irlan/irlan_common.c b/net/irda/irlan/irlan_common.c
index f5778ef..2650433 100644
--- a/net/irda/irlan/irlan_common.c
+++ b/net/irda/irlan/irlan_common.c
@@ -106,9 +106,9 @@ extern struct proc_dir_entry *proc_irda;
 
 static struct irlan_cb *irlan_open(__u32 saddr, __u32 daddr);
 static void __irlan_close(struct irlan_cb *self);
-static int __irlan_insert_param(struct sk_buff *skb, char *param, int type,
-				__u8 value_byte, __u16 value_short,
-				__u8 *value_array, __u16 value_len);
+static int __irlan_insert_param(struct sk_buff *skb, const char *param,
+				int type, __u8 value_byte, __u16 value_short,
+				const __u8 *value_array, __u16 value_len);
 static void irlan_open_unicast_addr(struct irlan_cb *self);
 static void irlan_get_unicast_addr(struct irlan_cb *self);
 void irlan_close_tsaps(struct irlan_cb *self);
@@ -960,12 +960,12 @@ void irlan_get_media_char(struct irlan_cb *self)
  *    Insert byte parameter into frame
  *
  */
-int irlan_insert_byte_param(struct sk_buff *skb, char *param, __u8 value)
+int irlan_insert_byte_param(struct sk_buff *skb, const char *param, __u8 value)
 {
 	return __irlan_insert_param(skb, param, IRLAN_BYTE, value, 0, NULL, 0);
 }
 
-int irlan_insert_short_param(struct sk_buff *skb, char *param, __u16 value)
+int irlan_insert_short_param(struct sk_buff *skb, const char *param, __u16 value)
 {
 	return __irlan_insert_param(skb, param, IRLAN_SHORT, 0, value, NULL, 0);
 }
@@ -976,7 +976,8 @@ int irlan_insert_short_param(struct sk_buff *skb, char *param, __u16 value)
  *    Insert string parameter into frame
  *
  */
-int irlan_insert_string_param(struct sk_buff *skb, char *param, char *string)
+int irlan_insert_string_param(struct sk_buff *skb, const char *param,
+			      const char *string)
 {
 	int string_len = strlen(string);
 
@@ -990,8 +991,8 @@ int irlan_insert_string_param(struct sk_buff *skb, char *param, char *string)
  *    Insert array parameter into frame
  *
  */
-int irlan_insert_array_param(struct sk_buff *skb, char *name, __u8 *array,
-			     __u16 array_len)
+int irlan_insert_array_param(struct sk_buff *skb, const char *name,
+			     __u8 *array, __u16 array_len)
 {
 	return __irlan_insert_param(skb, name, IRLAN_ARRAY, 0, 0, array,
 				    array_len);
@@ -1006,9 +1007,9 @@ int irlan_insert_array_param(struct sk_buff *skb, char *name, __u8 *array,
  *    | Name Length[1] | Param Name[1..255] | Val Length[2] | Value[0..1016]|
  *    -----------------------------------------------------------------------
  */
-static int __irlan_insert_param(struct sk_buff *skb, char *param, int type,
-				__u8 value_byte, __u16 value_short,
-				__u8 *value_array, __u16 value_len)
+static int __irlan_insert_param(struct sk_buff *skb, const char *param,
+				int type, __u8 value_byte, __u16 value_short,
+				const __u8 *value_array, __u16 value_len)
 {
 	__u8 *frame;
 	__u8 param_len;
diff --git a/net/irda/irlan/irlan_event.c b/net/irda/irlan/irlan_event.c
index 623e0fd..2d5d4c5 100644
--- a/net/irda/irlan/irlan_event.c
+++ b/net/irda/irlan/irlan_event.c
@@ -24,7 +24,7 @@
 
 #include <net/irda/irlan_event.h>
 
-char *irlan_state[] = {
+const char *irlan_state[] = {
 	"IRLAN_IDLE",
 	"IRLAN_QUERY",
 	"IRLAN_CONN",
diff --git a/net/irda/irlap.c b/net/irda/irlap.c
index 3d76aaf..587f249 100644
--- a/net/irda/irlap.c
+++ b/net/irda/irlap.c
@@ -63,7 +63,7 @@ static void irlap_init_qos_capabilities(struct irlap_cb *self,
 					struct qos_info *qos_user);
 
 #ifdef CONFIG_IRDA_DEBUG
-static char *lap_reasons[] = {
+static const char *lap_reasons[] = {
 	"ERROR, NOT USED",
 	"LAP_DISC_INDICATION",
 	"LAP_NO_RESPONSE",
diff --git a/net/irda/irnet/irnet_irda.c b/net/irda/irnet/irnet_irda.c
index a4f1439..f06c52f 100644
--- a/net/irda/irnet/irnet_irda.c
+++ b/net/irda/irnet/irnet_irda.c
@@ -1730,7 +1730,7 @@ irnet_proc_read(char *	buf,
 		int	len)
 {
   irnet_socket *	self;
-  char *		state;
+  const char *		state;
   int			i = 0;
 
   len = 0;
diff --git a/net/irda/parameters.c b/net/irda/parameters.c
index 2627dad..0486a8a 100644
--- a/net/irda/parameters.c
+++ b/net/irda/parameters.c
@@ -51,7 +51,7 @@ static int irda_insert_integer(void *self, __u8 *buf, int len, __u8 pi,
 static int irda_insert_no_value(void *self, __u8 *buf, int len, __u8 pi,
 				PV_TYPE type, PI_HANDLER func);
 
-static int irda_param_unpack(__u8 *buf, char *fmt, ...);
+static int irda_param_unpack(__u8 *buf, const char *fmt, ...);
 
 /* Parameter value call table. Must match PV_TYPE */
 static PV_HANDLER pv_extract_table[] = {
@@ -362,11 +362,11 @@ static int irda_extract_octseq(void *self, __u8 *buf, int len, __u8 pi,
  *        's' = string
  *
  */
-int irda_param_pack(__u8 *buf, char *fmt, ...)
+int irda_param_pack(__u8 *buf, const char *fmt, ...)
 {
 	irda_pv_t arg;
 	va_list args;
-	char *p;
+	const char *p;
 	int n = 0;
 
 	va_start(args, fmt);
@@ -405,11 +405,11 @@ EXPORT_SYMBOL(irda_param_pack);
 /*
  * Function irda_param_unpack (skb, fmt, ...)
  */
-static int irda_param_unpack(__u8 *buf, char *fmt, ...)
+static int irda_param_unpack(__u8 *buf, const char *fmt, ...)
 {
 	irda_pv_t arg;
 	va_list args;
-	char *p;
+	const char *p;
 	int n = 0;
 
 	va_start(args, fmt);
diff --git a/net/llc/llc_proc.c b/net/llc/llc_proc.c
index 49be6c9..700f229 100644
--- a/net/llc/llc_proc.c
+++ b/net/llc/llc_proc.c
@@ -141,7 +141,7 @@ out:
 	return 0;
 }
 
-static char *llc_conn_state_names[] = {
+static const char *llc_conn_state_names[] = {
 	[LLC_CONN_STATE_ADM] =        "adm",
 	[LLC_CONN_STATE_SETUP] =      "setup",
 	[LLC_CONN_STATE_NORMAL] =     "normal",
diff --git a/net/mac80211/debugfs_key.c b/net/mac80211/debugfs_key.c
index 7d56dc9..dd99896 100644
--- a/net/mac80211/debugfs_key.c
+++ b/net/mac80211/debugfs_key.c
@@ -46,7 +46,7 @@ static ssize_t key_algorithm_read(struct file *file,
 				  char __user *userbuf,
 				  size_t count, loff_t *ppos)
 {
-	char *alg;
+	const char *alg;
 	struct ieee80211_key *key = file->private_data;
 
 	switch (key->alg) {
diff --git a/net/netfilter/nf_conntrack_amanda.c b/net/netfilter/nf_conntrack_amanda.c
index e42ab23..195768b 100644
--- a/net/netfilter/nf_conntrack_amanda.c
+++ b/net/netfilter/nf_conntrack_amanda.c
@@ -53,7 +53,7 @@ enum amanda_strings {
 };
 
 static struct {
-	char			*string;
+	const char		*string;
 	size_t			len;
 	struct ts_config	*ts;
 } search[] __read_mostly = {
diff --git a/net/rose/rose_subr.c b/net/rose/rose_subr.c
index b05108f..3ae46d1 100644
--- a/net/rose/rose_subr.c
+++ b/net/rose/rose_subr.c
@@ -398,7 +398,7 @@ int rose_parse_facilities(unsigned char *p,
 static int rose_create_facilities(unsigned char *buffer, struct rose_sock *rose)
 {
 	unsigned char *p = buffer + 1;
-	char *callsign;
+	const char *callsign;
 	char buf[11];
 	int len, nb;
 
diff --git a/net/sched/act_api.c b/net/sched/act_api.c
index feef366..fc1585a 100644
--- a/net/sched/act_api.c
+++ b/net/sched/act_api.c
@@ -457,7 +457,8 @@ errout:
 }
 
 struct tc_action *tcf_action_init_1(struct rtattr *rta, struct rtattr *est,
-				    char *name, int ovr, int bind, int *err)
+				    const char *name, int ovr, int bind, 
+				    int *err)
 {
 	struct tc_action *a;
 	struct tc_action_ops *a_o;
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index ee88f2e..97ed3b8 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -105,7 +105,7 @@ static int sctp_do_bind(struct sock *, union sctp_addr *, int);
 static int sctp_autobind(struct sock *sk);
 static void sctp_sock_migrate(struct sock *, struct sock *,
 			      struct sctp_association *, sctp_socket_type_t);
-static char *sctp_hmac_alg = SCTP_COOKIE_HMAC_ALG;
+static const char *sctp_hmac_alg = SCTP_COOKIE_HMAC_ALG;
 
 extern struct kmem_cache *sctp_bucket_cachep;
 
diff --git a/net/sunrpc/auth_gss/gss_krb5_crypto.c b/net/sunrpc/auth_gss/gss_krb5_crypto.c
index bfb6a29..4958a7f 100644
--- a/net/sunrpc/auth_gss/gss_krb5_crypto.c
+++ b/net/sunrpc/auth_gss/gss_krb5_crypto.c
@@ -130,8 +130,8 @@ checksummer(struct scatterlist *sg, void *data)
 
 /* checksum the plaintext data and hdrlen bytes of the token header */
 s32
-make_checksum(char *cksumname, char *header, int hdrlen, struct xdr_buf *body,
-		   int body_offset, struct xdr_netobj *cksum)
+make_checksum(const char *cksumname, char *header, int hdrlen,
+	      struct xdr_buf *body, int body_offset, struct xdr_netobj *cksum)
 {
 	struct hash_desc                desc; /* XXX add to ctx? */
 	struct scatterlist              sg[1];
diff --git a/net/sunrpc/auth_gss/gss_krb5_mech.c b/net/sunrpc/auth_gss/gss_krb5_mech.c
index 9843eac..8786cde 100644
--- a/net/sunrpc/auth_gss/gss_krb5_mech.c
+++ b/net/sunrpc/auth_gss/gss_krb5_mech.c
@@ -82,7 +82,7 @@ get_key(const void *p, const void *end, struct crypto_blkcipher **res)
 {
 	struct xdr_netobj	key;
 	int			alg;
-	char			*alg_name;
+	const char		*alg_name;
 
 	p = simple_get_bytes(p, end, &alg, sizeof(alg));
 	if (IS_ERR(p))
diff --git a/net/sunrpc/auth_gss/gss_mech_switch.c b/net/sunrpc/auth_gss/gss_mech_switch.c
index 61801a0..66b59da 100644
--- a/net/sunrpc/auth_gss/gss_mech_switch.c
+++ b/net/sunrpc/auth_gss/gss_mech_switch.c
@@ -66,9 +66,9 @@ gss_mech_free(struct gss_api_mech *gm)
 }
 
 static inline char *
-make_auth_domain_name(char *name)
+make_auth_domain_name(const char *name)
 {
-	static char	*prefix = "gss/";
+	static const char *prefix = "gss/";
 	char		*new;
 
 	new = kmalloc(strlen(name) + strlen(prefix) + 1, GFP_KERNEL);
diff --git a/net/sunrpc/auth_gss/gss_spkm3_seal.c b/net/sunrpc/auth_gss/gss_spkm3_seal.c
index d158635..2102a6e 100644
--- a/net/sunrpc/auth_gss/gss_spkm3_seal.c
+++ b/net/sunrpc/auth_gss/gss_spkm3_seal.c
@@ -142,7 +142,7 @@ make_spkm3_checksum(s32 cksumtype, struct xdr_netobj *key, char *header,
 		    unsigned int hdrlen, struct xdr_buf *body,
 		    unsigned int body_offset, struct xdr_netobj *cksum)
 {
-	char				*cksumname;
+	const char			*cksumname;
 	struct hash_desc		desc; /* XXX add to ctx? */
 	struct scatterlist		sg[1];
 	int err;
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index 52429b1..2ace90f 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -121,7 +121,7 @@ rpc_setup_pipedir(struct rpc_clnt *clnt, char *dir_name)
 	}
 }
 
-static struct rpc_clnt * rpc_new_client(struct rpc_xprt *xprt, char *servname, struct rpc_program *program, u32 vers, rpc_authflavor_t flavor)
+static struct rpc_clnt * rpc_new_client(struct rpc_xprt *xprt, const char *servname, struct rpc_program *program, u32 vers, rpc_authflavor_t flavor)
 {
 	struct rpc_version	*version;
 	struct rpc_clnt		*clnt = NULL;
@@ -650,7 +650,7 @@ EXPORT_SYMBOL_GPL(rpc_peeraddr);
  * @format: address format
  *
  */
-char *rpc_peeraddr2str(struct rpc_clnt *clnt, enum rpc_display_format_t format)
+const char *rpc_peeraddr2str(struct rpc_clnt *clnt, enum rpc_display_format_t format)
 {
 	struct rpc_xprt *xprt = clnt->cl_xprt;
 
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
index 650af06..dff06f4 100644
--- a/net/sunrpc/rpc_pipe.c
+++ b/net/sunrpc/rpc_pipe.c
@@ -392,7 +392,7 @@ enum {
  * Description of fs contents.
  */
 struct rpc_filelist {
-	char *name;
+	const char *name;
 	const struct file_operations *i_fop;
 	int mode;
 };
diff --git a/net/sunrpc/rpcb_clnt.c b/net/sunrpc/rpcb_clnt.c
index d1740db..2dcc503 100644
--- a/net/sunrpc/rpcb_clnt.c
+++ b/net/sunrpc/rpcb_clnt.c
@@ -129,9 +129,9 @@ struct rpcbind_args {
 	u32			r_vers;
 	u32			r_prot;
 	unsigned short		r_port;
-	char *			r_netid;
+	const char *		r_netid;
 	char			r_addr[RPCB_MAXADDRLEN];
-	char *			r_owner;
+	const char *		r_owner;
 };
 
 static struct rpc_procinfo rpcb_procedures2[];
@@ -175,8 +175,9 @@ static void rpcb_wake_rpcbind_waiters(struct rpc_xprt *xprt, int status)
 	rpc_wake_up_status(&xprt->binding, status);
 }
 
-static struct rpc_clnt *rpcb_create(char *hostname, struct sockaddr *srvaddr,
-					int proto, int version, int privileged)
+static struct rpc_clnt *rpcb_create(const char *hostname, 
+				    struct sockaddr *srvaddr, int proto,
+				    int version, int privileged)
 {
 	struct rpc_create_args args = {
 		.protocol	= proto,
diff --git a/net/sunrpc/svcauth_unix.c b/net/sunrpc/svcauth_unix.c
index 4114794..cad05a8 100644
--- a/net/sunrpc/svcauth_unix.c
+++ b/net/sunrpc/svcauth_unix.c
@@ -164,7 +164,7 @@ static void ip_map_request(struct cache_detail *cd,
 	(*bpp)[-1] = '\n';
 }
 
-static struct ip_map *ip_map_lookup(char *class, struct in_addr addr);
+static struct ip_map *ip_map_lookup(const char *class, struct in_addr addr);
 static int ip_map_update(struct ip_map *ipm, struct unix_domain *udom, time_t expiry);
 
 static int ip_map_parse(struct cache_detail *cd,
@@ -239,7 +239,7 @@ static int ip_map_show(struct seq_file *m,
 {
 	struct ip_map *im;
 	struct in_addr addr;
-	char *dom = "-no-domain-";
+	const char *dom = "-no-domain-";
 
 	if (h == NULL) {
 		seq_puts(m, "#class IP domain\n");
@@ -280,7 +280,7 @@ struct cache_detail ip_map_cache = {
 	.alloc		= ip_map_alloc,
 };
 
-static struct ip_map *ip_map_lookup(char *class, struct in_addr addr)
+static struct ip_map *ip_map_lookup(const char *class, struct in_addr addr)
 {
 	struct ip_map ip;
 	struct cache_head *ch;
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index 4ae7eed..43b3405 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -186,7 +186,7 @@ static ctl_table sunrpc_table[] = {
 #endif
 
 #ifdef RPC_DEBUG_DATA
-static void xs_pktdump(char *msg, u32 *packet, unsigned int count)
+static void xs_pktdump(const char *msg, u32 *packet, unsigned int count)
 {
 	u8 *buf = (u8 *) packet;
 	int j;
@@ -204,7 +204,7 @@ static void xs_pktdump(char *msg, u32 *packet, unsigned int count)
 	dprintk("\n");
 }
 #else
-static inline void xs_pktdump(char *msg, u32 *packet, unsigned int count)
+static inline void xs_pktdump(const char *msg, u32 *packet, unsigned int count)
 {
 	/* NOP */
 }
diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c
index 271a375..9973378 100644
--- a/net/tipc/bearer.c
+++ b/net/tipc/bearer.c
@@ -89,7 +89,7 @@ static struct media *media_find(const char *name)
  */
 
 int  tipc_register_media(u32 media_type,
-			 char *name,
+			 const char *name,
 			 int (*enable)(struct tipc_bearer *),
 			 void (*disable)(struct tipc_bearer *),
 			 int (*send_msg)(struct sk_buff *,
diff --git a/net/tipc/config.c b/net/tipc/config.c
index c71337a..6613d19 100644
--- a/net/tipc/config.c
+++ b/net/tipc/config.c
@@ -87,7 +87,7 @@ struct sk_buff *tipc_cfg_reply_alloc(int payload_size)
 }
 
 int tipc_cfg_append_tlv(struct sk_buff *buf, int tlv_type,
-			void *tlv_data, int tlv_data_size)
+			const void *tlv_data, int tlv_data_size)
 {
 	struct tlv_desc *tlv = (struct tlv_desc *)skb_tail_pointer(buf);
 	int new_tlv_space = TLV_SPACE(tlv_data_size);
@@ -118,7 +118,7 @@ struct sk_buff *tipc_cfg_reply_unsigned_type(u16 tlv_type, u32 value)
 	return buf;
 }
 
-struct sk_buff *tipc_cfg_reply_string_type(u16 tlv_type, char *string)
+struct sk_buff *tipc_cfg_reply_string_type(u16 tlv_type, const char *string)
 {
 	struct sk_buff *buf;
 	int string_len = strlen(string) + 1;
diff --git a/net/tipc/config.h b/net/tipc/config.h
index 5cd7cc5..09618d5 100644
--- a/net/tipc/config.h
+++ b/net/tipc/config.h
@@ -44,9 +44,9 @@
 
 struct sk_buff *tipc_cfg_reply_alloc(int payload_size);
 int tipc_cfg_append_tlv(struct sk_buff *buf, int tlv_type,
-			void *tlv_data, int tlv_data_size);
+			const void *tlv_data, int tlv_data_size);
 struct sk_buff *tipc_cfg_reply_unsigned_type(u16 tlv_type, u32 value);
-struct sk_buff *tipc_cfg_reply_string_type(u16 tlv_type, char *string);
+struct sk_buff *tipc_cfg_reply_string_type(u16 tlv_type, const char *string);
 
 static inline struct sk_buff *tipc_cfg_reply_none(void)
 {
@@ -58,12 +58,12 @@ static inline struct sk_buff *tipc_cfg_reply_unsigned(u32 value)
 	return tipc_cfg_reply_unsigned_type(TIPC_TLV_UNSIGNED, value);
 }
 
-static inline struct sk_buff *tipc_cfg_reply_error_string(char *string)
+static inline struct sk_buff *tipc_cfg_reply_error_string(const char *string)
 {
 	return tipc_cfg_reply_string_type(TIPC_TLV_ERROR_STRING, string);
 }
 
-static inline struct sk_buff *tipc_cfg_reply_ultra_string(char *string)
+static inline struct sk_buff *tipc_cfg_reply_ultra_string(const char *string)
 {
 	return tipc_cfg_reply_string_type(TIPC_TLV_ULTRA_STRING, string);
 }
diff --git a/net/tipc/dbg.c b/net/tipc/dbg.c
index e809d2a..aa2d8d1 100644
--- a/net/tipc/dbg.c
+++ b/net/tipc/dbg.c
@@ -132,7 +132,7 @@ int tipc_printbuf_empty(struct print_buf *pb)
 
 int tipc_printbuf_validate(struct print_buf *pb)
 {
-	char *err = "\n\n*** PRINT BUFFER OVERFLOW ***\n\n";
+	const char *err = "\n\n*** PRINT BUFFER OVERFLOW ***\n\n";
 	char *cp_buf;
 	struct print_buf cb;
 
diff --git a/net/tipc/link.c b/net/tipc/link.c
index 1d674e0..c3ba2ed 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -3017,7 +3017,7 @@ static int tipc_link_stats(const char *name, char *buf, const u32 buf_size)
 	struct print_buf pb;
 	struct link *l_ptr;
 	struct node *node;
-	char *status;
+	const char *status;
 	u32 profile_total = 0;
 
 	if (!strcmp(name, tipc_bclink_name))
diff --git a/net/tipc/name_table.c b/net/tipc/name_table.c
index d8473ee..d27094d 100644
--- a/net/tipc/name_table.c
+++ b/net/tipc/name_table.c
@@ -858,7 +858,7 @@ static void subseq_list(struct sub_seq *sseq, struct print_buf *buf, u32 depth,
 			u32 index)
 {
 	char portIdStr[27];
-	char *scopeStr;
+	const char *scopeStr;
 	struct publication *publ = sseq->zone_list;
 
 	tipc_printf(buf, "%-10u %-10u ", sseq->lower, sseq->upper);
diff --git a/net/wireless/wext.c b/net/wireless/wext.c
index d6aaf65..d950cef 100644
--- a/net/wireless/wext.c
+++ b/net/wireless/wext.c
@@ -1187,7 +1187,7 @@ static void rtmsg_iwinfo(struct net_device *dev, char *event, int event_len)
 void wireless_send_event(struct net_device *	dev,
 			 unsigned int		cmd,
 			 union iwreq_data *	wrqu,
-			 char *			extra)
+			 const char *		extra)
 {
 	const struct iw_ioctl_description *	descr = NULL;
 	int extra_len = 0;

^ permalink raw reply related

* Re: [ofa-general] Re: Re: Re: [PATCH V3 0/7] net/bonding: ADD IPoIB support for the bonding driver
From: Moni Shoua @ 2007-08-01 14:12 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Or Gerlitz, netdev, Roland Dreier, fubar, general, davem
In-Reply-To: <20070731142234.GC16015@mellanox.co.il>


> It's always wrong to copy symbols from another module without
> referencing it.

Michael,
It seems like the preferred approach is to prevent ib_ipoib from being 
unloaded while bonding is on top it, right?
It seems like it would handle all safety issues (not just neigh cleanup).



^ permalink raw reply

* Re: specifying scopid's for link-local IPv6 addrs
From: Vlad Yasevich @ 2007-08-01 14:25 UTC (permalink / raw)
  To: Rick Jones; +Cc: Bill Fink, Linux Network Development list
In-Reply-To: <46A63327.6010705@hp.com>

Rick Jones wrote:
>> Rick,
>>
>> I don't see any way around this.  For example, on one of my test
>> systems, I have the following link local routes:
>>
>> chance% netstat -A inet6 -rn | grep fe80::/64
>> fe80::/64                                  
>> ::                                      U     256    0        0 eth0
>> fe80::/64                                  
>> ::                                      U     256    0        0 eth2
>> fe80::/64                                  
>> ::                                      U     256    0        0 eth3
>> fe80::/64                                  
>> ::                                      U     256    0        0 eth4
>> fe80::/64                                  
>> ::                                      U     256    0        0 eth5
>> fe80::/64                                  
>> ::                                      U     256    0        0 eth6
>>
>> So if I want to run a link local test to fe80::202:b3ff:fed4:cd1,
>> the system has no way to choose which is the correct interface to
>> use for the test, and will give an error if the interface isn't
>> specified. 
> 
> Yeah, I was wondering about that.  I'm not sure if the attempts on
> "those other OSes" happened to involve multiple interfaces or not.

Yes, there have been attempts.   BSD has a concept of default interface.
The default interface is used when the user did not specify the interface/
scope_id.

Other OSs do different things.  For example, Tru64 (to pick on a dead system)
would try to find the right interface base on the preferences you could
set up.

But, in the end the whole thing is really utterly broken since no-one has
truly implemented scoped address architecture for link-local addresses.
The concept of the link is so closely tied to the 'interface' that I don't
know anyone who has separated the two.


>  Even
> so, it "feels" unpleasant for an application to deal with and I wonder
> if there is a way for a stack to deal with it on the application's
> behalf.  I guess that might involve some sort of layer violation between
> neightbor discovery and routing (typing while I think about things I
> know little about...)
> 
> Is there RFC chapter and verse I might read about routing with multiple
> link-local's on a system?

See RFC 4007 for the concepts.  

> 
>> You must explicitly specify the desired interface.  For example,
>> on my test system, the correct interface is eth6 which is interface 8
>> (lo eth0 eth1 eth2 ... eth5 eth6).  Here is an example nuttcp test
>> specifying interface 8:
>>
>> chance% nuttcp -P5100 fe80::202:b3ff:fed4:cd1%8
>>  1178.5809 MB /  10.02 sec =  986.2728 Mbps 12 %TX 15 %RX
>>
>> nuttcp uses getaddrinfo() which parses the "%<ifindex>" field,
>> and then copies the sin6_scope_id from the res structure to the
>> server's sockaddr_in6 structure before initiating the connect().
> 
> OK, I'll give that a quick try with netperf:
> 
> [root@hpcpc106 ~]# netperf -H 192.168.2.107 -c -C -i 30,3 -- -s 1M -S 1M
> -m 64K -H fe80::207:43ff:fe05:9d%2
> TCP STREAM TEST from ::0 (::) port 0 AF_INET6 to
> fe80::207:43ff:fe05:9d%2 (fe80::207:43ff:fe05:9d) port 0 AF_INET6 :
> +/-2.5% @ 99% conf.
> 
> Cool - it establishes the data connection just fine.
> 
> 
> To further demonstrate my ignorance :)  is that %n suffix something one
> might expect in most/all getaddrinfo()'s or is that unique to the one in
> Linux?

This is becoming more generic.  I believe HP-UX supports it (if the don't
you should kick them :).

-vlad

^ permalink raw reply

* Re: [PATCH]: Fix sk_buff page offsets and lengths.
From: Eric Dumazet @ 2007-07-31  8:52 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, sfr, shemminger
In-Reply-To: <20070730.185028.26532012.davem@davemloft.net>

On Mon, 30 Jul 2007 18:50:28 -0700 (PDT)
David Miller <davem@davemloft.net> wrote:

> 
> Stephen Rothwell pointed out to me that the skb_frag_struct
> is broken on platforms using 64K or larger page sizes, it
> even generates warnings when (for example) the myri10ge driver
> tries to assign PAGE_SIZE into frag->size.
> 
> I've thus increased page offset and size to __u32 in the patch below.
> 
> I made this change much to even my own chagrin, but this is the
> most direct fix and the ifdefs we could put here are both ugly
> and also not something that we do with struct scatterlist so
> no reason to do it in a place like this.
> 
> Actually, the cost on 64-bit is zero because there existed 4 bytes of
> alignment padding for skb_frag_struct because of the page pointer.
> On 32-bit the cost is up to 64-bytes :-/
> 
> Stephen, this opens up the doors a bit for the scatterlist work
> you wanted to do in sk_buff.
> 

Ouch... 

sizeof(struct skb_shared_info) is enlarged by 18*4 bytes on i386, a litle bit more than 64 bytes :(

I understand ifdefs are ugly, but in the common case (PAGE_SIZE<64K), this change seems very unfortunate.


^ permalink raw reply

* Re: [PATCH] prevent SSB compilation on s390 part 2
From: Heiko Carstens @ 2007-08-01 14:43 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-kernel, netdev, John W. Linville, Michael Buesch,
	Martin Schwidefsky, Jeff Garzik
In-Reply-To: <20070801093404.GA12124@osiris.boeblingen.de.ibm.com>

On Wed, Aug 01, 2007 at 11:34:04AM +0200, Heiko Carstens wrote:
> From: Heiko Carstens <heiko.carstens@de.ibm.com>
> 
> drivers/ssb/Kconfig has already a depends on HAS_IOMEM which should
> prevent SSB from being selected. But appearantly it looks like this
> doesn't matter at all if it gets selected from somewhere else.
> So add an explicit depends on HAS_IOMEM to the Broadcom driver to
> prevent selection on s390.
> 
> Cc: "John W. Linville" <linville@tuxdriver.com>
> Cc: Michael Buesch <mb@bu3sch.de>
> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
> ---
>  drivers/net/Kconfig |    1 +
>  1 files changed, 1 insertion(+)
> 
> Index: linux-2.6.22/drivers/net/Kconfig
> ===================================================================
> --- linux-2.6.22.orig/drivers/net/Kconfig
> +++ linux-2.6.22/drivers/net/Kconfig
> @@ -1434,6 +1434,7 @@ config APRICOT
> 
>  config B44
>  	tristate "Broadcom 440x/47xx ethernet support"
> +	depends on HAS_IOMEM
>  	select SSB
>  	select MII
>  	help

By the way.. wouldn't something like depends on NET_PCI or something
similar more correct for this driver? Just wondering...

^ permalink raw reply

* Re: [PATCH] prevent SSB compilation on s390 part 2
From: Michael Buesch @ 2007-08-01 14:54 UTC (permalink / raw)
  To: Heiko Carstens
  Cc: Andrew Morton, linux-kernel, netdev, John W. Linville,
	Martin Schwidefsky, Jeff Garzik
In-Reply-To: <20070801144308.GC12124@osiris.boeblingen.de.ibm.com>

On Wednesday 01 August 2007, Heiko Carstens wrote:
> On Wed, Aug 01, 2007 at 11:34:04AM +0200, Heiko Carstens wrote:
> > From: Heiko Carstens <heiko.carstens@de.ibm.com>
> > 
> > drivers/ssb/Kconfig has already a depends on HAS_IOMEM which should
> > prevent SSB from being selected. But appearantly it looks like this
> > doesn't matter at all if it gets selected from somewhere else.
> > So add an explicit depends on HAS_IOMEM to the Broadcom driver to
> > prevent selection on s390.
> > 
> > Cc: "John W. Linville" <linville@tuxdriver.com>
> > Cc: Michael Buesch <mb@bu3sch.de>
> > Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
> > Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
> > ---
> >  drivers/net/Kconfig |    1 +
> >  1 files changed, 1 insertion(+)
> > 
> > Index: linux-2.6.22/drivers/net/Kconfig
> > ===================================================================
> > --- linux-2.6.22.orig/drivers/net/Kconfig
> > +++ linux-2.6.22/drivers/net/Kconfig
> > @@ -1434,6 +1434,7 @@ config APRICOT
> > 
> >  config B44
> >  	tristate "Broadcom 440x/47xx ethernet support"
> > +	depends on HAS_IOMEM
> >  	select SSB
> >  	select MII
> >  	help
> 
> By the way.. wouldn't something like depends on NET_PCI or something
> similar more correct for this driver? Just wondering...
> 
> 

No, B44 does not depend on PCI. It does depend on the SSB bus.
(Of course the SSB PCI parts do depend on PCI)

^ permalink raw reply

* [PATCH] remove get_perm_addr from ucc_geth_ethtool.c
From: Jan Altenberg @ 2007-08-01 15:04 UTC (permalink / raw)
  To: leoli; +Cc: netdev, Linux Kernel list

Remove get_perm_addr from ucc_geth_ethtool.c

This is needed because commit 313674afa8fdced2fe79f50f38e1c387b63d8790
inlines the generic function to the caller.

Signed-off-by: Jan Altenberg <jan.altenberg@linutronix.de>

---
 drivers/net/ucc_geth_ethtool.c |    1 -
 1 file changed, 1 deletion(-)

Index: linux-2.6/drivers/net/ucc_geth_ethtool.c
===================================================================
--- linux-2.6.orig/drivers/net/ucc_geth_ethtool.c
+++ linux-2.6/drivers/net/ucc_geth_ethtool.c
@@ -379,7 +379,6 @@ static const struct ethtool_ops uec_etht
 	.get_stats_count        = uec_get_stats_count,
 	.get_strings            = uec_get_strings,
 	.get_ethtool_stats      = uec_get_ethtool_stats,
-	.get_perm_addr          = ethtool_op_get_perm_addr,
 };
 
 void uec_set_ethtool_ops(struct net_device *netdev)



^ permalink raw reply

* [PATCH 2/2] NET: fix memory leaks from security_secid_to_secctx()
From: Paul Moore @ 2007-08-01 15:12 UTC (permalink / raw)
  To: netdev, selinux; +Cc: Paul Moore
In-Reply-To: <20070801151257.475951538@hp.com>

[-- Attachment #1: network-audit_ctx_leaks --]
[-- Type: text/plain, Size: 1670 bytes --]

The security_secid_to_secctx() function returns memory that must be freed
by a call to security_release_secctx() which was not always happening.  This
patch fixes two of these problems (all that I could find in the kernel source
at present).

Signed-off-by: Paul Moore <paul.moore@hp.com>
---
 net/netlabel/netlabel_user.c |    4 +++-
 net/xfrm/xfrm_policy.c       |    5 +++--
 2 files changed, 6 insertions(+), 3 deletions(-)

Index: linux-2.6_secctx-leaks/net/netlabel/netlabel_user.c
===================================================================
--- linux-2.6_secctx-leaks.orig/net/netlabel/netlabel_user.c
+++ linux-2.6_secctx-leaks/net/netlabel/netlabel_user.c
@@ -113,8 +113,10 @@ struct audit_buffer *netlbl_audit_start_
 	if (audit_info->secid != 0 &&
 	    security_secid_to_secctx(audit_info->secid,
 				     &secctx,
-				     &secctx_len) == 0)
+				     &secctx_len) == 0) {
 		audit_log_format(audit_buf, " subj=%s", secctx);
+		security_release_secctx(secctx, secctx_len);
+	}
 
 	return audit_buf;
 }
Index: linux-2.6_secctx-leaks/net/xfrm/xfrm_policy.c
===================================================================
--- linux-2.6_secctx-leaks.orig/net/xfrm/xfrm_policy.c
+++ linux-2.6_secctx-leaks/net/xfrm/xfrm_policy.c
@@ -2195,9 +2195,10 @@ void xfrm_audit_log(uid_t auid, u32 sid,
 	}
 
 	if (sid != 0 &&
-		security_secid_to_secctx(sid, &secctx, &secctx_len) == 0)
+	    security_secid_to_secctx(sid, &secctx, &secctx_len) == 0) {
 		audit_log_format(audit_buf, " subj=%s", secctx);
-	else
+		security_release_secctx(secctx, secctx_len);
+	} else
 		audit_log_task_context(audit_buf);
 
 	if (xp) {

-- 
paul moore
linux security @ hp

^ permalink raw reply

* [PATCH 1/2] SELinux: remove redundant pointer checks before calling kfree()
From: Paul Moore @ 2007-08-01 15:12 UTC (permalink / raw)
  To: netdev, selinux; +Cc: Paul Moore
In-Reply-To: <20070801151257.475951538@hp.com>

[-- Attachment #1: selinux-kfree_check --]
[-- Type: text/plain, Size: 678 bytes --]

We don't need to check for NULL pointers before calling kfree().

Signed-off-by: Paul Moore <paul.moore@hp.com>
---
 security/selinux/hooks.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Index: linux-2.6_secctx-leaks/security/selinux/hooks.c
===================================================================
--- linux-2.6_secctx-leaks.orig/security/selinux/hooks.c
+++ linux-2.6_secctx-leaks/security/selinux/hooks.c
@@ -4658,8 +4658,7 @@ static int selinux_secid_to_secctx(u32 s
 
 static void selinux_release_secctx(char *secdata, u32 seclen)
 {
-	if (secdata)
-		kfree(secdata);
+	kfree(secdata);
 }
 
 #ifdef CONFIG_KEYS

-- 
paul moore
linux security @ hp

^ permalink raw reply

* [PATCH 0/2] Small memory-leak patchset
From: Paul Moore @ 2007-08-01 15:12 UTC (permalink / raw)
  To: netdev, selinux

While doing some other work I found some small memory leaks with the way
we are using security_secid_to_secctx() in some of the auditing code paths.
We also had a redundant NULL pointer check in the SELinux function which frees
the leaked memory.  This patchset fixes both of these issues.

This patchset is backed against Linus' tree from this morning and has been
lightly tested.

-- 
paul moore
linux security @ hp

^ permalink raw reply

* [patch] sis190 check for ISA bridge on SiS966
From: maximilian attems @ 2007-08-01 15:52 UTC (permalink / raw)
  To: netdev; +Cc: jgarzik, Neil Muller

From: Neil Muller <drnlmuller+bugs@gmail.com>

sis190 driver assumes to find ISA only on SiS965.
similar fix is in sis900 driver, see bug report
http://bugs.debian.org/435547

Signed-off-by: maximilian attems <max@stro.at>

---

 drivers/net/sis190.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/sis190.c b/drivers/net/sis190.c
index ec2ad9f..d470b19 100644
--- a/drivers/net/sis190.c
+++ b/drivers/net/sis190.c
@@ -1593,6 +1593,9 @@ static int __devinit sis190_get_mac_addr_from_apc(struct pci_dev *pdev,
 		  pci_name(pdev));
 
 	isa_bridge = pci_get_device(PCI_VENDOR_ID_SI, 0x0965, NULL);
+	if (!isa_bridge)
+		isa_bridge = pci_get_device(PCI_VENDOR_ID_SI, 0x0966, NULL);
+
 	if (!isa_bridge) {
 		net_probe(tp, KERN_INFO "%s: Can not find ISA bridge.\n",
 			  pci_name(pdev));

-- 
maks

^ permalink raw reply related

* Re: [ofa-general] Re: Re: Re: [PATCH V3 0/7] net/bonding: ADD IPoIB support for the bonding driver
From: Michael S. Tsirkin @ 2007-08-01 16:10 UTC (permalink / raw)
  To: Moni Shoua
  Cc: netdev, Roland Dreier, fubar, Michael S. Tsirkin, general, davem
In-Reply-To: <46B094CA.3080904@gmail.com>

> Quoting Moni Shoua <monisonlists@gmail.com>:
> Subject: Re: [ofa-general] Re: Re: Re: [PATCH V3 0/7] net/bonding: ADD IPoIB support for?the bonding driver
> 
> 
> > It's always wrong to copy symbols from another module without
> > referencing it.
> 
> Michael,
> It seems like the preferred approach is to prevent ib_ipoib from being 
> unloaded while bonding is on top it, right?
> It seems like it would handle all safety issues (not just neigh cleanup).

Donnu about preferred, but that'll work I think.

-- 
MST

^ permalink raw reply

* Re: [PATCH FINAL] Merge the Sonics Silicon Backplane subsystem
From: Andrew Morton @ 2007-08-01 16:55 UTC (permalink / raw)
  To: Michael Buesch
  Cc: linux-kernel, bcm43xx-dev-0fE9KPoRgkgATYTw5x5z8w,
	netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA, Gary Zambrano,
	John Linville
In-Reply-To: <200708011133.37214.mb-fseUSCV1ubazQB+pC5nmwQ@public.gmane.org>

On Wed, 1 Aug 2007 11:33:36 +0200 Michael Buesch <mb-fseUSCV1ubazQB+pC5nmwQ@public.gmane.org> wrote:

> > 
> > yup, it's `select':
> > 
> > Selected by: B44 && NETDEVICES && NET_ETHERNET || BCM43XX_MAC80211 && NETDEVICES && !S390 && MAC80211 && WLAN_80211 && EXPERIMENTAL
> > 
> > 
> > Look.  Kconfig's `select' Just.  Does.  Not.  Work.  If you find yourself
> > contemplating using it, please, don sackcloth, take a cold shower and
> > several analgesics, then have another go, OK?
> > 
> > ho hum.
> 
> Ah, yeah. Crap select not caring about dependencies...
> The problem is that people will kill me, if they don't find
> bcm43xx in the kconfig anymore, as they have to enable ssb
> before that. Ya know the flame with Uwe Bugla going crazy
> about that? :D
> Same goes for b44. It was always there in kconfig without
> additional deps, but now (when we merge the b44 port) we would
> need ssb selected before we see b44.

We just don't have a good solution to this.

`select' is bust and it's unobvious how it can _not_ be bust.  If you're
selecting something whose dependencies aren't met, what can we do?  Maybe
select the thing it depends on as well?  What if it depends on (A||B)? 
Which one do we force on?  Screwed.

And hiding options from the users until theyve gone elsewher and selected
something else is most user-hostile.

At least we have menuconfig's "/" command, so if you know the option's name
you can work out why it isn't appearing.

I think what we should do is to continue to offer the unselectable option
in manuconfig and friends, only "greyed out" in some fashion.  So the user
can still navigate to it and select the "what do you depend on" button.

> Maybe default SSB to M?

People would complain about that too.  I don't know what to do, sorry. 
Muddle through :(

^ permalink raw reply

* Re: [REGRESSION] tg3 dead after s2ram
From: Michael Chan @ 2007-08-01 17:47 UTC (permalink / raw)
  To: Joachim Deguara
  Cc: Andrew Morton, lkml List, Michal Piotrowski, netdev, linux-acpi
In-Reply-To: <200708011001.24384.joachim.deguara@amd.com>

On Wed, 2007-08-01 at 10:01 +0200, Joachim Deguara wrote:

> Here are the lspci outputs for the tg3

You have 2 Broadcom devices in your system.  07:00.0 is a wireless
device, I think.  8:4.0 is the tg3 device.

It's clear that the tg3 device is still in D3 state after resume and
that explains why all register accesses fail.  tg3_resume() should put
the device back in D0 state in a very straight forward way and I don't
see how that can fail.  It worked for me when I tested it last night.
Can you add some printk() to tg3_resume() to see what's happening?  Let
me know if you want me to send you some debug patches to do that.

Thanks.

Here's the before and after for 8:4.0:

> 
> Before
>
> 08:04.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5788 Gigabit 
> Ethernet (rev 03)
> 	Subsystem: Acer Incorporated [ALI] Unknown device 010e
> 	Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- 
> SERR- FastB2B-
> 	Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- 
> <MAbort- >SERR- <PERR-
> 	Latency: 0 (16000ns min)
> 	Interrupt: pin A routed to IRQ 22
> 	Region 0: Memory at d0300000 (32-bit, non-prefetchable) [size=64K]
> 	Expansion ROM at <ignored> [disabled]
> 	Capabilities: [48] Power Management version 2
> 		Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot+,D3cold+)
> 		Status: D0 PME-Enable- DSel=0 DScale=1 PME-
> 	Capabilities: [50] Vital Product Data
> 	Capabilities: [58] Message Signalled Interrupts: Mask- 64bit+ Queue=0/3 
> Enable-
> 		Address: ffff6bfe7fffffb8  Data: fec7
> 00: e4 14 9c 16 06 00 b0 02 03 00 00 02 00 00 00 00
> 10: 00 00 30 d0 00 00 00 00 00 00 00 00 00 00 00 00
> 20: 00 00 00 00 00 00 00 00 07 00 00 00 25 10 0e 01
> 30: 00 00 ff ff 48 00 00 00 00 00 00 00 0a 01 40 00
> 40: 00 00 00 00 00 00 00 00 01 50 02 c0 00 20 00 00
> 50: 03 58 fc 00 6f bf be 7f 05 00 86 00 b8 ff ff 7f
> 60: fe 6b ff ff c7 fe 00 00 98 00 03 30 00 00 3f 76
> 70: f6 10 00 00 20 00 00 80 14 04 00 00 00 00 00 00
> 80: 85 6b d0 36 03 40 00 0c 34 00 13 04 82 90 09 04
> 90: 09 97 00 01 00 00 00 00 00 00 00 00 eb 01 00 00
> a0: 00 00 00 00 23 01 00 00 00 00 00 00 cb 00 00 00
> b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> 
> After
> 
> 08:04.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5788 Gigabit 
> Ethernet (rev 03)
> 	Subsystem: Acer Incorporated [ALI] Unknown device 010e
> 	Control: I/O- Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- 
> SERR- FastB2B-
> 	Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- 
> <MAbort- >SERR- <PERR-
> 	Interrupt: pin A routed to IRQ 22
> 	Region 0: Memory at d0300000 (32-bit, non-prefetchable) [disabled] [size=64K]
> 	Expansion ROM at <ignored> [disabled]
> 	Capabilities: [48] Power Management version 2
> 		Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot+,D3cold+)
> 		Status: D0 PME-Enable+ DSel=0 DScale=1 PME-
> 	Capabilities: [50] Vital Product Data
> 	Capabilities: [58] Message Signalled Interrupts: Mask- 64bit+ Queue=0/3 
> Enable-
> 		Address: ffff6bfe7fffffb8  Data: fec7
> 00: e4 14 9c 16 00 00 b0 02 03 00 00 02 00 00 00 00
> 10: 00 00 30 d0 00 00 00 00 00 00 00 00 00 00 00 00
> 20: 00 00 00 00 00 00 00 00 07 00 00 00 25 10 0e 01
> 30: 00 00 ff ff 48 00 00 00 00 00 00 00 0a 01 40 00
> 40: 00 00 00 00 00 00 00 00 01 50 02 c0 00 21 00 64
> 50: 03 58 fc 00 6f bf be 7f 05 00 86 00 b8 ff ff 7f
> 60: fe 6b ff ff c7 fe 00 00 9a 00 03 30 00 00 00 00
> 70: 76 10 00 00 40 00 00 00 50 00 00 00 00 00 00 00
> 80: 03 58 fc 00 00 00 00 00 00 00 00 00 fe 90 09 04
> 90: 01 07 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> 



^ permalink raw reply

* [RFC][PATCH] Removal of duplicated include net/wanrouter/wanmain.c
From: Michal Piotrowski @ 2007-08-01 17:58 UTC (permalink / raw)
  To: Andrew Morton, Netdev, LKML

Hi,

There is no need to include linux/init.h twice

Regards,
Michal

--
LOG
http://www.stardust.webpages.pl/log/

Signed-off-by: Michal Piotrowski <michal.k.k.piotrowski@gmail.com>

--- linux-mm-clean/net/wanrouter/wanmain.c	2007-07-09 01:32:17.000000000 +0200
+++ linux-mm/net/wanrouter/wanmain.c	2007-08-01 18:14:22.000000000 +0200
@@ -46,7 +46,6 @@
 #include <linux/capability.h>
 #include <linux/errno.h>	/* return codes */
 #include <linux/kernel.h>
-#include <linux/init.h>
 #include <linux/module.h>	/* support for loadable modules */
 #include <linux/slab.h>		/* kmalloc(), kfree() */
 #include <linux/mm.h>

^ permalink raw reply

* [PATCH 1/2] [TCP]: Also handle snd_una changes in tcp_cwnd_down
From: Ilpo Järvinen @ 2007-08-01 18:05 UTC (permalink / raw)
  To: David Miller; +Cc: Netdev

[-- Attachment #1: Type: TEXT/PLAIN, Size: 6430 bytes --]


tcp_cwnd_down must check for it too as it should be conservative
in case of collapse stuff and also when receiver is trying to
lie (though that wouldn't be very successful/useful anyway).

Note:
- Separated also is_dupack and do_lost in fast_retransalert
	* Much cleaner look-and-feel now
	* This time it really fixes cumulative ACK with many new
	  SACK blocks recovery entry (I claimed this fixes with
	  last patch but it wasn't). TCP will now call
	  tcp_update_scoreboard regardless of is_dupack when
	  in recovery as long as there is enough fackets_out.
- Introduce FLAG_SND_UNA_ADVANCED
	* Some prior_snd_una arguments are unnecessary after it
- Added helper FLAG_ANY_PROGRESS to avoid long FLAG...|FLAG...
  constructs

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
---

Dave, BEWARE, I wasn't able to do anything else but compile test
because Linus' tree didn't seem to boot on the machine I was
trying to test it... :-(

I think that to stable version only a small part of this change
is necessary, not the full changeset. That should keep stable
folks much happier... :-) I'll soon put my reduced proposal to:
  http://www.cs.helsinki.fi/u/ijjarvin/patches/stable-0001.patch
The other patch (DSACK) can go to stable as is.

 net/ipv4/tcp_input.c |   34 ++++++++++++++++++----------------
 1 files changed, 18 insertions(+), 16 deletions(-)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 378ca8a..c3124e6 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -102,11 +102,13 @@ int sysctl_tcp_abc __read_mostly;
 #define FLAG_DATA_LOST		0x80 /* SACK detected data lossage.		*/
 #define FLAG_SLOWPATH		0x100 /* Do not skip RFC checks for window update.*/
 #define FLAG_ONLY_ORIG_SACKED	0x200 /* SACKs only non-rexmit sent before RTO */
+#define FLAG_SND_UNA_ADVANCED	0x400 /* Snd_una was changed (!= FLAG_DATA_ACKED) */
 
 #define FLAG_ACKED		(FLAG_DATA_ACKED|FLAG_SYN_ACKED)
 #define FLAG_NOT_DUP		(FLAG_DATA|FLAG_WIN_UPDATE|FLAG_ACKED)
 #define FLAG_CA_ALERT		(FLAG_DATA_SACKED|FLAG_ECE)
 #define FLAG_FORWARD_PROGRESS	(FLAG_ACKED|FLAG_DATA_SACKED)
+#define FLAG_ANY_PROGRESS	(FLAG_FORWARD_PROGRESS|FLAG_SND_UNA_ADVANCED)
 
 #define IsReno(tp) ((tp)->rx_opt.sack_ok == 0)
 #define IsFack(tp) ((tp)->rx_opt.sack_ok & 2)
@@ -1856,7 +1858,7 @@ static void tcp_cwnd_down(struct sock *sk, int flag)
 	struct tcp_sock *tp = tcp_sk(sk);
 	int decr = tp->snd_cwnd_cnt + 1;
 
-	if ((flag&FLAG_FORWARD_PROGRESS) ||
+	if ((flag&FLAG_ANY_PROGRESS) ||
 	    (IsReno(tp) && !(flag&FLAG_NOT_DUP))) {
 		tp->snd_cwnd_cnt = decr&1;
 		decr >>= 1;
@@ -2107,15 +2109,13 @@ static void tcp_mtup_probe_success(struct sock *sk, struct sk_buff *skb)
  * tcp_xmit_retransmit_queue().
  */
 static void
-tcp_fastretrans_alert(struct sock *sk, u32 prior_snd_una,
-		      int prior_packets, int flag)
+tcp_fastretrans_alert(struct sock *sk, int prior_packets, int flag)
 {
 	struct inet_connection_sock *icsk = inet_csk(sk);
 	struct tcp_sock *tp = tcp_sk(sk);
-	int is_dupack = (tp->snd_una == prior_snd_una &&
-			 (!(flag&FLAG_NOT_DUP) ||
-			  ((flag&FLAG_DATA_SACKED) &&
-			   (tp->fackets_out > tp->reordering))));
+	int is_dupack = !(flag&(FLAG_SND_UNA_ADVANCED|FLAG_NOT_DUP));
+	int do_lost = is_dupack || ((flag&FLAG_DATA_SACKED) &&
+				    (tp->fackets_out > tp->reordering));
 
 	/* Some technical things:
 	 * 1. Reno does not count dupacks (sacked_out) automatically. */
@@ -2192,14 +2192,14 @@ tcp_fastretrans_alert(struct sock *sk, u32 prior_snd_una,
 	/* F. Process state. */
 	switch (icsk->icsk_ca_state) {
 	case TCP_CA_Recovery:
-		if (prior_snd_una == tp->snd_una) {
+		if (!(flag & FLAG_SND_UNA_ADVANCED)) {
 			if (IsReno(tp) && is_dupack)
 				tcp_add_reno_sack(sk);
 		} else {
 			int acked = prior_packets - tp->packets_out;
 			if (IsReno(tp))
 				tcp_remove_reno_sacks(sk, acked);
-			is_dupack = tcp_try_undo_partial(sk, acked);
+			do_lost = tcp_try_undo_partial(sk, acked);
 		}
 		break;
 	case TCP_CA_Loss:
@@ -2215,7 +2215,7 @@ tcp_fastretrans_alert(struct sock *sk, u32 prior_snd_una,
 		/* Loss is undone; fall through to processing in Open state. */
 	default:
 		if (IsReno(tp)) {
-			if (tp->snd_una != prior_snd_una)
+			if (flag & FLAG_SND_UNA_ADVANCED)
 				tcp_reset_reno_sack(tp);
 			if (is_dupack)
 				tcp_add_reno_sack(sk);
@@ -2264,7 +2264,7 @@ tcp_fastretrans_alert(struct sock *sk, u32 prior_snd_una,
 		tcp_set_ca_state(sk, TCP_CA_Recovery);
 	}
 
-	if (is_dupack || tcp_head_timedout(sk))
+	if (do_lost || tcp_head_timedout(sk))
 		tcp_update_scoreboard(sk);
 	tcp_cwnd_down(sk, flag);
 	tcp_xmit_retransmit_queue(sk);
@@ -2684,7 +2684,7 @@ static void tcp_undo_spur_to_response(struct sock *sk, int flag)
  *     to prove that the RTO is indeed spurious. It transfers the control
  *     from F-RTO to the conventional RTO recovery
  */
-static int tcp_process_frto(struct sock *sk, u32 prior_snd_una, int flag)
+static int tcp_process_frto(struct sock *sk, int flag)
 {
 	struct tcp_sock *tp = tcp_sk(sk);
 
@@ -2704,8 +2704,7 @@ static int tcp_process_frto(struct sock *sk, u32 prior_snd_una, int flag)
 		 * ACK isn't duplicate nor advances window, e.g., opposite dir
 		 * data, winupdate
 		 */
-		if ((tp->snd_una == prior_snd_una) && (flag&FLAG_NOT_DUP) &&
-		    !(flag&FLAG_FORWARD_PROGRESS))
+		if (!(flag&FLAG_ANY_PROGRESS) && (flag&FLAG_NOT_DUP))
 			return 1;
 
 		if (!(flag&FLAG_DATA_ACKED)) {
@@ -2785,6 +2784,9 @@ static int tcp_ack(struct sock *sk, struct sk_buff *skb, int flag)
 	if (before(ack, prior_snd_una))
 		goto old_ack;
 
+	if (after(ack, prior_snd_una))
+		flag |= FLAG_SND_UNA_ADVANCED;
+
 	if (sysctl_tcp_abc) {
 		if (icsk->icsk_ca_state < TCP_CA_CWR)
 			tp->bytes_acked += ack - prior_snd_una;
@@ -2837,14 +2839,14 @@ static int tcp_ack(struct sock *sk, struct sk_buff *skb, int flag)
 	flag |= tcp_clean_rtx_queue(sk, &seq_rtt);
 
 	if (tp->frto_counter)
-		frto_cwnd = tcp_process_frto(sk, prior_snd_una, flag);
+		frto_cwnd = tcp_process_frto(sk, flag);
 
 	if (tcp_ack_is_dubious(sk, flag)) {
 		/* Advance CWND, if state allows this. */
 		if ((flag & FLAG_DATA_ACKED) && !frto_cwnd &&
 		    tcp_may_raise_cwnd(sk, flag))
 			tcp_cong_avoid(sk, ack, prior_in_flight, 0);
-		tcp_fastretrans_alert(sk, prior_snd_una, prior_packets, flag);
+		tcp_fastretrans_alert(sk, prior_packets, flag);
 	} else {
 		if ((flag & FLAG_DATA_ACKED) && !frto_cwnd)
 			tcp_cong_avoid(sk, ack, prior_in_flight, 1);
-- 
1.5.0.6

^ permalink raw reply related

* [PATCH 2/2] [TCP]: DSACK signals data receival, be conservative
From: Ilpo Järvinen @ 2007-08-01 18:06 UTC (permalink / raw)
  To: David Miller; +Cc: Netdev
In-Reply-To: <Pine.LNX.4.64.0708012054180.27657@kivilampi-30.cs.helsinki.fi>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1810 bytes --]


In case a DSACK is received, it's better to lower cwnd as it's
a sign of data receival.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
---
 net/ipv4/tcp_input.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index c3124e6..f030435 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -103,6 +103,7 @@ int sysctl_tcp_abc __read_mostly;
 #define FLAG_SLOWPATH		0x100 /* Do not skip RFC checks for window update.*/
 #define FLAG_ONLY_ORIG_SACKED	0x200 /* SACKs only non-rexmit sent before RTO */
 #define FLAG_SND_UNA_ADVANCED	0x400 /* Snd_una was changed (!= FLAG_DATA_ACKED) */
+#define FLAG_DSACKING_ACK	0x800 /* SACK blocks contained DSACK info */
 
 #define FLAG_ACKED		(FLAG_DATA_ACKED|FLAG_SYN_ACKED)
 #define FLAG_NOT_DUP		(FLAG_DATA|FLAG_WIN_UPDATE|FLAG_ACKED)
@@ -966,12 +967,14 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_
 
 	/* Check for D-SACK. */
 	if (before(ntohl(sp[0].start_seq), TCP_SKB_CB(ack_skb)->ack_seq)) {
+		flag |= FLAG_DSACKING_ACK;
 		found_dup_sack = 1;
 		tp->rx_opt.sack_ok |= 4;
 		NET_INC_STATS_BH(LINUX_MIB_TCPDSACKRECV);
 	} else if (num_sacks > 1 &&
 			!after(ntohl(sp[0].end_seq), ntohl(sp[1].end_seq)) &&
 			!before(ntohl(sp[0].start_seq), ntohl(sp[1].start_seq))) {
+		flag |= FLAG_DSACKING_ACK;
 		found_dup_sack = 1;
 		tp->rx_opt.sack_ok |= 4;
 		NET_INC_STATS_BH(LINUX_MIB_TCPDSACKOFORECV);
@@ -1858,7 +1861,7 @@ static void tcp_cwnd_down(struct sock *sk, int flag)
 	struct tcp_sock *tp = tcp_sk(sk);
 	int decr = tp->snd_cwnd_cnt + 1;
 
-	if ((flag&FLAG_ANY_PROGRESS) ||
+	if ((flag&(FLAG_ANY_PROGRESS|FLAG_DSACKING_ACK)) ||
 	    (IsReno(tp) && !(flag&FLAG_NOT_DUP))) {
 		tp->snd_cwnd_cnt = decr&1;
 		decr >>= 1;
-- 
1.5.0.6

^ permalink raw reply related

* Re: [Bugme-new] [Bug 8808] New: Large file transfer causes kernel panic showing b44_poll
From: Gary Zambrano @ 2007-08-01 16:36 UTC (permalink / raw)
  To: Andrew Morton; +Cc: netdev, bugme-daemon@bugzilla.kernel.org, simsondem
In-Reply-To: <20070725115456.f7dac506.akpm@linux-foundation.org>

On Wed, 2007-07-25 at 11:54 -0700, Andrew Morton wrote:
> On Wed, 25 Jul 2007 04:29:33 -0700 (PDT)
> bugme-daemon@bugzilla.kernel.org wrote:
> 
> > http://bugzilla.kernel.org/show_bug.cgi?id=8808
> > 
> >            Summary: Large file transfer causes kernel panic showing b44_poll
> >            Product: Drivers
> >            Version: 2.5
> >      KernelVersion: 2.6.22.1
> >           Platform: All
> >         OS/Version: Linux
> >               Tree: Mainline
> >             Status: NEW
> >           Severity: blocking
> >           Priority: P1
> >          Component: Network
> >         AssignedTo: jgarzik@pobox.com
> >         ReportedBy: simsondem@gmail.com
> > 
> > 
> > Most recent kernel where this bug did not occur: /
> > Distribution: ttylinux 
> > Hardware Environment: Dell Inspiron 1300
> > Problem Description: 
> > 
> > A large file transfer (6.5GB) (tried http with wget and plain netcat) causes a
> > kernel panic after more than several GB have been transferred. However, kernel
> > panic does not occur consistently. That is, it has occurred after 1.2GB, 1.8GB,
> > 2.3GB and even 3.4GB transferred. Transfer never finished though. 
> > 
I could not repro the problem, but please give this patch a try:

diff -rup a/b44.c b/b44.c
--- a/b44.c	2007-07-31 15:31:08.000000000 -0700
+++ b/b44.c	2007-08-01 08:03:08.000000000 -0700
@@ -792,15 +792,15 @@ static int b44_rx(struct b44 *bp, int bu
 			goto next_pkt;
 		}
 
-		if (len == 0) {
+		if (len < 5) {
 			int i = 0;
 
 			do {
 				udelay(2);
 				barrier();
 				len = le16_to_cpu(rh->len);
-			} while (len == 0 && i++ < 5);
-			if (len == 0)
+			} while (len < 5 && i++ < 5);
+			if (len < 5)
 				goto drop_it;
 		}
 




^ permalink raw reply

* [PATCH] Inconsistent behaviour at AF_PACKET
From: Unai Uribarri @ 2007-08-01 19:00 UTC (permalink / raw)
  To: netdev

Hello folks,

Timestamps should be usually requested explicitly by setting the
SOL_SOCKET/SO_TIMESTAMP option to 1. But if you setup a reception ring
with the SOL_PACKET/PACKET_RX_RING option, timestamps are automatically
enabled at the next packet recepcion.

I think that is a bug so I have written a patch that corrects it.

Thanks.

diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 1322d62..a4f2da3 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -640,10 +640,6 @@ static int tpacket_rcv(struct sk_buff *skb, struct
net_device *dev, struct packe
        h->tp_snaplen = snaplen;
        h->tp_mac = macoff;
        h->tp_net = netoff;
-       if (skb->tstamp.tv64 == 0) {
-               __net_timestamp(skb);
-               sock_enable_timestamp(sk);
-       }
        tv = ktime_to_timeval(skb->tstamp);
        h->tp_sec = tv.tv_sec;
        h->tp_usec = tv.tv_usec;




^ permalink raw reply related


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