From fnaumann@mail.cs.uni-magdeburg.de Mon Nov 3 10:54:41 2003 Date: Mon, 3 Nov 2003 10:41:26 +0100 (CET) From: Standa Opichal To: MiNT Mailing List Subject: [MiNT] Bug? sys/sockets/inet4/if.c Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Delivered-To: mint@fishpool.com Delivered-To: mint@lists.fishpool.fi X-ecartis-version: Ecartis v1.0.0 Sender: mint-bounce@lists.fishpool.fi Errors-to: mint-bounce@lists.fishpool.fi X-original-sender: opichals@seznam.cz Precedence: bulk List-help: List-unsubscribe: List-ID: X-List-ID: 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;