All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: David Howells <dhowells@redhat.com>
Cc: Evgeniy Polyakov <johnpol@2ka.mipt.ru>, netdev@vger.kernel.org
Subject: Re: How to find I/F to destination
Date: Fri, 04 May 2007 15:43:41 +0200	[thread overview]
Message-ID: <463B388D.806@trash.net> (raw)
In-Reply-To: <11217.1178285625@redhat.com>

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.

  reply	other threads:[~2007-05-04 13:44 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-04 12:48 How to find I/F to destination David Howells
2007-05-04 12:54 ` Evgeniy Polyakov
2007-05-04 13:04   ` David Howells
2007-05-04 13:06     ` David Howells
2007-05-04 13:08   ` David Howells
2007-05-04 13:16     ` Evgeniy Polyakov
2007-05-04 13:24       ` David Howells
2007-05-04 13:29         ` Evgeniy Polyakov
2007-05-04 13:33           ` David Howells
2007-05-04 13:43             ` Patrick McHardy [this message]
2007-05-04 13:55               ` David Howells
2007-05-04 13:59                 ` Patrick McHardy
2007-05-05  9:13                   ` Evgeniy Polyakov
2007-05-05  9:15             ` Evgeniy Polyakov
2007-05-04 13:20     ` Evgeniy Polyakov
2007-05-04 13:23   ` David Howells
2007-05-04 13:25     ` Evgeniy Polyakov
2007-05-04 13:00 ` Patrick McHardy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=463B388D.806@trash.net \
    --to=kaber@trash.net \
    --cc=dhowells@redhat.com \
    --cc=johnpol@2ka.mipt.ru \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.