Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

freebsd-net Digest, Vol 365, Issue 2

1 view
Skip to first unread message

freebsd-n...@freebsd.org

unread,
Mar 30, 2010, 8:00:24 AM3/30/10
to freeb...@freebsd.org
Send freebsd-net mailing list submissions to
freeb...@freebsd.org

To subscribe or unsubscribe via the World Wide Web, visit
http://lists.freebsd.org/mailman/listinfo/freebsd-net
or, via email, send a message with subject or body 'help' to
freebsd-n...@freebsd.org

You can reach the person managing the list at
freebsd-...@freebsd.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of freebsd-net digest..."


Today's Topics:

1. ::1 magically replaced with other address (Pieter de Boer)
2. Re: kern/145123: network connection freezes if using WPA-PSK
encryption with 2 Atheros WIFI cards on AR9285 chipset connected
to same AP (Eugeny N Dzhurinsky)
3. Small patch to ipfilter for arm (M. Warner Losh)
4. Re: kern/145123: [ath] network connection freezes if using
WPA-PSK encryption with 2 Atheros WIFI cards on AR9285 chipset
connected to same AP (v...@FreeBSD.org)
5. space of ath_node (jiani1012)
6. Re: Small patch to ipfilter for arm (Bruce Evans)
7. Re: space of ath_node (Rui Paulo)


----------------------------------------------------------------------

Message: 1
Date: Mon, 29 Mar 2010 19:35:15 +0200
From: Pieter de Boer <pie...@os3.nl>
Subject: ::1 magically replaced with other address
To: freeb...@freebsd.org
Message-ID: <4BB0E4D...@os3.nl>
Content-Type: text/plain; charset=UTF-8; format=flowed

Hullo,

On my 8.0-RELEASE-p1 system, my ::1 address on lo0 has been magically
replaced with a global routable IPv6 address I have configured on lo3.
This has happened two times with a week or so interval, without me doing
any ifconfigs. With `replaced' I mean that ::1 is simply gone from the
interface, although a route to it remains. Instead of ::1, one of the
addresses configured on lo3 is also there on lo0.

The address that ::1 is suddenly replaced with, is assigned to a jail
that has it assigned to a child jail. There are also other IPv6
addresses assigned to this jail and its child jail, but those don't show
up on lo0 all of a sudden: only one out of the set does.

My question is, has anyone seen anything like this or does anyone have a
clue how I could debug this? I cannot easily reboot the affected system
to add debugging statements to the kernel, etc, but perhaps there are
other ways?

Thanks,
Pieter


------------------------------

Message: 2
Date: Mon, 29 Mar 2010 17:50:03 GMT
From: Eugeny N Dzhurinsky <bo...@redwerk.com>
Subject: Re: kern/145123: network connection freezes if using WPA-PSK
encryption with 2 Atheros WIFI cards on AR9285 chipset connected to
same AP
To: freeb...@FreeBSD.org
Message-ID: <201003291750....@freefall.freebsd.org>

The following reply was made to PR kern/145123; it has been noted by GNATS.

From: Eugeny N Dzhurinsky <bo...@redwerk.com>
To: bug-fo...@FreeBSD.org, bo...@redwerk.com
Cc:
Subject: Re: kern/145123: network connection freezes if using WPA-PSK
encryption with 2 Atheros WIFI cards on AR9285 chipset connected to same
AP
Date: Mon, 29 Mar 2010 20:40:43 +0300

Sorry, my bad. After trying to investigate the problem on access point I
realized that there was conflict between IP addresses of network adapters on
laptops, which I should notice immediately if I would look carefully at logs
on AP side.

So please close this PR.

Shame on me...


------------------------------

Message: 3
Date: Mon, 29 Mar 2010 11:51:16 -0600 (MDT)
From: "M. Warner Losh" <i...@bsdimp.com>
Subject: Small patch to ipfilter for arm
To: n...@FreeBSD.org
Message-ID: <20100329.115116.385...@bsdimp.com>
Content-Type: Text/Plain; charset=us-ascii

OK. I'd like to propose the following patch for ipfilter:

Index: sys/contrib/ipfilter/netinet/ip_compat.h
===================================================================
--- sys/contrib/ipfilter/netinet/ip_compat.h (revision 205838)
+++ sys/contrib/ipfilter/netinet/ip_compat.h (working copy)
@@ -975,7 +975,6 @@
# define SPL_NET(x) ;
# define SPL_IMP(x) ;
# define SPL_SCHED(x) ;
-extern int in_cksum __P((struct mbuf *, int));
# else
# define SPL_SCHED(x) x = splhigh()
# endif /* __FreeBSD_version >= 500043 */

This declaration is wrong, and it prevents arm from building ipfilter.

Why is it wrong? Because we have:

# if (__FreeBSD_version >= 500002)
# include <netinet/in_systm.h>
# include <netinet/ip.h>
# include <machine/in_cksum.h>
# endif

# if (__FreeBSD_version >= 500043)
...
<the above code>
...
# endif

So, we have in_cksum.h being included *AND* we're defining this
function. However, in_cksum.h is supposed to do this.

Why don't we see problems today? No architecture except arm has an
assembler in_cksum in the tree. All the other architectures have

#define in_cksum(a, b) in_cksum_skip(a, b, 0)

in their headers. Since the above extern uses __P to hide the args,
in_cksum doesn't expand the macro, so we don't see any problems or
conflicts. On arm, where we define in_cksum() correctly to return
u_short, there's a conflict.

So, it would best if we just dropped this one line from ip_compat.h,
since it was always wrong anyway.

Comments?

Warner


------------------------------

Message: 4
Date: Mon, 29 Mar 2010 19:42:07 GMT
From: v...@FreeBSD.org
Subject: Re: kern/145123: [ath] network connection freezes if using
WPA-PSK encryption with 2 Atheros WIFI cards on AR9285 chipset
connected to same AP
To: bo...@redwerk.com, v...@FreeBSD.org, freeb...@FreeBSD.org
Message-ID: <201003291942....@freefall.freebsd.org>

Synopsis: [ath] network connection freezes if using WPA-PSK encryption with 2 Atheros WIFI cards on AR9285 chipset connected to same AP

State-Changed-From-To: open->closed
State-Changed-By: vwe
State-Changed-When: Mon Mar 29 19:41:11 UTC 2010
State-Changed-Why:
submitter requests to close this
thank you Eugeny for reporting and feeding back

http://www.freebsd.org/cgi/query-pr.cgi?pr=145123


------------------------------

Message: 5
Date: Tue, 30 Mar 2010 08:58:21 +0800 (CST)
From: jiani1012 <jian...@126.com>
Subject: space of ath_node
To: freebsd-net <freeb...@freebsd.org>
Message-ID: <cba400.f3c8.127ac9383...@126.com>
Content-Type: text/plain; charset=gbk

Hi,all
A problem puzzled me in ath code. The following code in function ath_node_alloc( ) shows the space allocated to an,

>struct ath_ratectrl {
>size_t arc_space; /* space required for per-node state */
>};

>const size_t space = sizeof(struct ath_node) + sc->sc_rc->arc_space;
>struct ath_node *an;
>an = malloc(space, M_80211_NODE, M_NOWAIT|M_ZERO);

but in the two lines below ,what is (an)[1]? Where is the initialization of (an)[1]? What does it contain? Can you show me? and how to get the content of sn?

>struct sample_node *sn = ATH_NODE_SAMPLE(an); /*in sample.c*/
>#define ATH_NODE_SAMPLE(an) ((struct sample_node *)&(an)[1]) /*in sample.h*/

Otherwise, the struct ath_ratectrl has been used in structures ath_softc, sample_softc and so on. Is there any relations between them?

Thank you!
Jeny


------------------------------

Message: 6
Date: Tue, 30 Mar 2010 11:16:35 +1100 (EST)
From: Bruce Evans <br...@optusnet.com.au>
Subject: Re: Small patch to ipfilter for arm
To: "M. Warner Losh" <i...@bsdimp.com>
Cc: n...@freebsd.org
Message-ID: <2010033010...@delplex.bde.org>
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed

On Mon, 29 Mar 2010, M. Warner Losh wrote:

> OK. I'd like to propose the following patch for ipfilter:
>
> Index: sys/contrib/ipfilter/netinet/ip_compat.h
> ===================================================================
> --- sys/contrib/ipfilter/netinet/ip_compat.h (revision 205838)
> +++ sys/contrib/ipfilter/netinet/ip_compat.h (working copy)
> @@ -975,7 +975,6 @@
> # define SPL_NET(x) ;
> # define SPL_IMP(x) ;
> # define SPL_SCHED(x) ;
> -extern int in_cksum __P((struct mbuf *, int));
> # else
> # define SPL_SCHED(x) x = splhigh()
> # endif /* __FreeBSD_version >= 500043 */
>
> This declaration is wrong, and it prevents arm from building ipfilter.

Quite likely. It even uses __P(()), whose use is supposed to have gone away
~10 years ago. But this file's purpose is to provide compat cruft like that.

Also, the null SPL's in the above have bogus semicolons.

> Why is it wrong? Because we have:
>
> # if (__FreeBSD_version >= 500002)
> # include <netinet/in_systm.h>
> # include <netinet/ip.h>
> # include <machine/in_cksum.h>
> # endif
>
> # if (__FreeBSD_version >= 500043)
> ...
> <the above code>
> ...
> # endif
>
> So, we have in_cksum.h being included *AND* we're defining this
> function. However, in_cksum.h is supposed to do this.
>
> Why don't we see problems today? No architecture except arm has an
> assembler in_cksum in the tree. All the other architectures have
>
> #define in_cksum(a, b) in_cksum_skip(a, b, 0)
>
> in their headers. Since the above extern uses __P to hide the args,
> in_cksum doesn't expand the macro, so we don't see any problems or
> conflicts.

Not quite. __P(()) does expand args, except for K&R compilers whose
use is supposed to have gone away ~20 years ago. However, the macro
has precedence over the declaration, so the declaration has no effect
(if there is a macro). The ordering of the includes has to be delicate
to get the function declared before the macro, else the declaration would
be a syntax error.

On arm, where we define in_cksum() correctly to return
> u_short, there's a conflict.
>
> So, it would best if we just dropped this one line from ip_compat.h,
> since it was always wrong anyway.

I agree. This line is only for non-old FreeBSD systems. It can never
have had any good effect on these systems, since even if it were correct
then it would have forced failure due to -Wredundant-decls (since the
delicate include ordering requires including the system header at the
correct point and this include is forced in ip_compat.h itself); thus
the system definition is always visible and any private declaration
gives a redundant-decl). FreeBSD uses -Wredundant-decls to inhibit
use of private decls like this.

Bruce


------------------------------

Message: 7
Date: Tue, 30 Mar 2010 12:25:29 +0100
From: Rui Paulo <rpa...@freebsd.org>
Subject: Re: space of ath_node
To: jiani1012 <jian...@126.com>
Cc: freebsd-net <freeb...@freebsd.org>
Message-ID: <06B53E1D-48A7-4739...@freebsd.org>
Content-Type: text/plain; charset=us-ascii


On 30 Mar 2010, at 01:58, jiani1012 wrote:

> Hi,all
> A problem puzzled me in ath code. The following code in function ath_node_alloc( ) shows the space allocated to an,
>
>> struct ath_ratectrl {
>> size_t arc_space; /* space required for per-node state */
>> };
>
>> const size_t space = sizeof(struct ath_node) + sc->sc_rc->arc_space;
>> struct ath_node *an;
>> an = malloc(space, M_80211_NODE, M_NOWAIT|M_ZERO);
>
> but in the two lines below ,what is (an)[1]? Where is the initialization of (an)[1]? What does it contain? Can you show me? and how to get the content of sn?
>
>> struct sample_node *sn = ATH_NODE_SAMPLE(an); /*in sample.c*/
>> #define ATH_NODE_SAMPLE(an) ((struct sample_node *)&(an)[1]) /*in sample.h*/
>
> Otherwise, the struct ath_ratectrl has been used in structures ath_softc, sample_softc and so on. Is there any relations between them?

Think about memory in the following way:

an[0] .................................. an[1] ...................
struct ath_node struct sample_node

Indexing an[1] gives the address past the end of struct ath_node, which is the start address of struct sample_node.

--
Rui Paulo

------------------------------


End of freebsd-net Digest, Vol 365, Issue 2
*******************************************

0 new messages