[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cipe
Subject:    Re: Source IP address automagic?
From:       Matthias_Wächter <matthias () waechter ! wol ! at>
Date:       1999-12-08 12:09:18
[Download RAW message or body]

On Wed, 8 Dec 1999, SadMan wrote:

> Hi,
> 
> > To come to the point: I already found (and patched) the Linux routine
> > selecting the "optimal" source address (/usr/src/linux/net/ipv4/devinet.c,
> > inet_select_addr; I specified that it should ignore all cipe interfaces
> > when searching for source IP address candidates).
> 
> unless someone finds some better solution, would you be so kind to send me
> that patch? 

In fact, it's a hack. Since this routine may be called really often, I
tried to speed things up, so I just specified that the first letter of the
interface's name mustn't be 'c' to be eventually used as a source address
- I don't check the other characters of the IF name, since all my
IFs other than 'cipecb...' start with other characters. So take care! :-)

Hope it helps anyway.

--- /usr/src/linux/net/ipv4/devinet.c.old	Wed Dec  8 13:00:21 1999
+++ /usr/src/linux/net/ipv4/devinet.c	Wed Dec  8 02:38:48 1999
@@ -650,7 +650,7 @@
 		return 0;
 
 	for_primary_ifa(in_dev) {
-		if (ifa->ifa_scope > scope)
+		if (ifa->ifa_scope > scope || ifa->ifa_label[0]=='c')
 			continue;
 		if (!dst || inet_ifa_match(dst, ifa))
 			return ifa->ifa_local;

Sehr Wus,
- Matthias

-- 
Wer reitet so spät durch Nacht und Wind?
- Wos waas I
-----------------------------------------------------------------------------


--
Message sent by the cipe-l@inka.de mailing list.
Unsubscribe: mail majordomo@inka.de, "unsubscribe cipe-l" in body
Other commands available with "help" in body to the same address.
CIPE info and list archive: <URL:http://sites.inka.de/~bigred/devel/cipe.html>

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic