[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1284714533.3391.53.camel@edumazet-laptop>
Date: Fri, 17 Sep 2010 11:08:53 +0200
From: Eric Dumazet <eric.dumazet@...il.com>
To: Nicola Padovano <nicola.padovano@...il.com>
Cc: AIJAZ BAIG <aijazbaig1@...il.com>,
netfilter-devel <netfilter-devel@...r.kernel.org>,
netdev@...r.kernel.org
Subject: Re: problem with flowi structure
Le vendredi 17 septembre 2010 à 10:46 +0200, Nicola Padovano a écrit :
> Aijaz, great! Now it' clear. Thank you.
> It remains a problem: the meaning of
>
> fl.nl_u.ip4_u.saddr = 0
>
> But, first of all:
> - we know that a routing table doesn't contain the ip source
> - but the routing cache contains it.
>
> so my first question is: why routing cache has it and routing cache
> not? what it its usage?
> Then my second question: the meaning of fl.nl_u.ip4_u.saddr = 0
>
> thank you very much
# ip addr show dev eth1
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP
qlen 1000 txqueues 4
link/ether f4:ce:46:bb:32:d4 brd ff:ff:ff:ff:ff:ff
inet 192.168.20.108/24 brd 192.168.20.255 scope global eth1
inet6 fe80::f6ce:46ff:febb:32d4/64 scope link
valid_lft forever preferred_lft forever
# ip addr add 192.168.20.67/24 dev eth1
# ip addr show dev eth1
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP
qlen 1000 txqueues 4
link/ether f4:ce:46:bb:32:d4 brd ff:ff:ff:ff:ff:ff
inet 192.168.20.108/24 brd 192.168.20.255 scope global eth1
inet 192.168.20.67/24 scope global secondary eth1
inet6 fe80::f6ce:46ff:febb:32d4/64 scope link
valid_lft forever preferred_lft forever
# ip ro
192.168.20.0/24 dev eth1 proto kernel scope link src 192.168.20.108
default via 192.168.20.254 dev eth1
# ip ro flush cache
# ip ro flush cache
# ip ro get 192.168.20.110
192.168.20.110 dev eth1 src 192.168.20.108
cache mtu 1500 advmss 1460 hoplimit 64
# ip ro get 192.168.20.110 from 192.168.20.67
192.168.20.110 from 192.168.20.67 dev eth1
cache mtu 1500 advmss 1460 hoplimit 64
# ip ro list cache
192.168.20.110 dev eth1 src 192.168.20.108
cache mtu 1500 advmss 1460 hoplimit 64
192.168.20.110 from 192.168.20.67 dev eth1
cache mtu 1500 advmss 1460 hoplimit 64
You can see two different routes in cache to reach 192.168.20.110,
one from "0.0.0.0" (we force src 192.168.20.108),
one from 192.168.20.67
With different keys (src addr, tos, fwmark, ...) we can have a lot of
different routes for apparently same destination
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists