[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <463B388D.806@trash.net>
Date: Fri, 04 May 2007 15:43:41 +0200
From: Patrick McHardy <kaber@...sh.net>
To: David Howells <dhowells@...hat.com>
CC: Evgeniy Polyakov <johnpol@....mipt.ru>, netdev@...r.kernel.org
Subject: Re: How to find I/F to destination
David Howells wrote:
> static void rxrpc_assess_MTU_size(struct rxrpc_peer *peer)
> {
> struct rtable *rt;
> struct flowi fl;
> int ret;
>
> peer->if_mtu = 1500;
>
> memset(&fl, 0, sizeof(fl));
>
> switch (peer->srx.transport.family) {
> case AF_INET:
> fl.oif = 0;
> fl.proto = IPPROTO_UDP,
> fl.nl_u.ip4_u.saddr = 0;
> fl.nl_u.ip4_u.daddr = peer->srx.transport.sin.sin_addr.s_addr;
> fl.nl_u.ip4_u.tos = 0;
> /* assume AFS.CM talking to AFS.FS */
> fl.uli_u.ports.sport = htonl(7001);
> fl.uli_u.ports.dport = htonl(7000);
htons()
> break;
> default:
> BUG();
> }
>
> ret = ip_route_output_key(&rt, &fl);
> if (ret < 0) {
> kleave(" [route err %d]", ret);
> return;
> }
>
> peer->if_mtu = dst_mtu(&rt->u.dst);
You need dst_release(&rt->u.dst) here.
-
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