[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[MiNT] inet4.xdd bug?
Hi!
Ok, I've found that the route_add() statement seems ok in if.c as we want
the machine to go to 'lo' interface in case we send something to our own
IP address, sure.
But there is still a bug IMHO regarding the if_primary assignment in
if_open(). Someone to confirm this?
regards
STan
PS: So the key patch would look like (set every just opened NIF as the
primary one):
--- inet4/if.c 9 Jan 2002 23:10:14 -0000 1.5
+++ inet4/if.c 3 Nov 2003 09:33:10 -0000
@@ -382,10 +382,12 @@
/*
* Want a running primary interface
*/
- if (!(if_primary->flags & IFF_UP))
if_primary = nif;
On Mon, 3 Nov 2003, Standa Opichal wrote:
> Hi!
>
> I've been playing with UDP packet sending in the current CVS kernel
> version. The UDP broadcast packets are sent to the primary nif normally
> there.
>
> I've found a strange thing in $subj file (see the patch snippet below) in
> if_open() function where there is no if_primary assignment (change) in
> case the old if_primary nif is up. Moreover there was a default route
> assignment always done to the if_lo interface. This is strange. Could
> someone verify my thoughts where every just opened nif should become the
> primary one (to get the broadcast UDP sent to that) and also the default
> route should be changed to just newly opened nif as well.
>
> I can commit it to the CVS of course, but I wanted to be checked by
> someone else.
>
> best regards
>
> STanda
>
>
> --- inet4/if.c 9 Jan 2002 23:10:14 -0000 1.5
> +++ inet4/if.c 3 Nov 2003 09:33:10 -0000
> @@ -382,10 +382,12 @@
> /*
> * Want a running primary interface
> */
> - if (!(if_primary->flags & IFF_UP))
> if_primary = nif;
>
> - route_add (if_lo, SIN (&ifa->addr)->sin_addr.s_addr, 0xffffffffL,
> + route_add (nif, SIN (&ifa->addr)->sin_addr.s_addr, 0xffffffffL,
> INADDR_ANY, RTF_STATIC|RTF_UP|RTF_HOST|RTF_LOCAL, 999, 0);
>
> return 0;
>
>
>
>