Re: Socket selection.
From: Andre Oppermann (andre_at_freebsd.org)
Date: 05/20/04
- Previous message: Pawel Jakub Dawidek: "Re: ia_netbroadcast"
- In reply to: Pawel Jakub Dawidek: "Socket selection."
- Next in thread: Pawel Jakub Dawidek: "Re: Socket selection."
- Reply: Pawel Jakub Dawidek: "Re: Socket selection."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 20 May 2004 23:01:46 +0200 To: Pawel Jakub Dawidek <pjd@FreeBSD.org>
Pawel Jakub Dawidek wrote:
>
> Hello.
>
> In in_pcblookup_hash() function, in the last loop if we find exact
> match, we return immediately, if it is "wild", we store a pointer and
> we countinue looking for exact match.
> I wonder if this is ok, that we change pointer every time we find a
> "wild" match. Is it inteded? Shouldn't it be:
>
> http://people.freebsd.org/~pjd/patches/in_pcb.c.2.patch
No. This is a stack variable which is unconditionally initialized to
NULL a few lines earlier. Checking for variable == NULL is always
going to be true and makes your 'optimization' just redundand.
> While I'm here, I want to improve code readability a bit:
>
> http://people.freebsd.org/~pjd/patches/in_pcb.c.3.patch
>
> Is it ok?
No. You change the logic of the 'if' statements to something totally
different. This ain't going to work in any way.
-- Andre _______________________________________________ freebsd-net@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-net To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"
- Previous message: Pawel Jakub Dawidek: "Re: ia_netbroadcast"
- In reply to: Pawel Jakub Dawidek: "Socket selection."
- Next in thread: Pawel Jakub Dawidek: "Re: Socket selection."
- Reply: Pawel Jakub Dawidek: "Re: Socket selection."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]