netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: hirofumi@mail.parknet.co.jp
Cc: netdev@vger.kernel.org
Subject: Re: problem of "ipv4: revert Set rt->rt_iif more sanely on output routes."
Date: Wed, 06 Apr 2011 22:42:44 -0700 (PDT)	[thread overview]
Message-ID: <20110406.224244.104071339.davem@davemloft.net> (raw)
In-Reply-To: <20110406.223400.71127145.davem@davemloft.net>

From: David Miller <davem@davemloft.net>
Date: Wed, 06 Apr 2011 22:34:00 -0700 (PDT)

> From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
> Date: Thu, 07 Apr 2011 13:31:06 +0900
> 
>> I'm not pretty sure though, output message is
>> 
>> 	ip_finish_output2: No header cache and no neighbour!
>> 
>> I'm not debugging this though,
>> 
>> static inline bool rt_is_output_route(struct rtable *rt)
>> {
>> 	return rt->rt_iif == 0;
>> }
>> 
>> from review I guess the above is one of cause.
> 
> arp_bind_neighbour() is only called if rt_is_output_route() is true
> or route is unicast.
> 
> If packet is sent using a route for which arp_bind_neighbour() has not
> been called, you will see that warning message.

Ok, the problem is that, for output routes in original code:

1) user's flow device index is stored in rt->rt_iif

2) arp_bind_neighbour() tests meanwhile used rt->fl.iif

So we do need, for now, to add a new member.  But I think for
correct semantics it needs to have inverse meaning to the one
you added in your RFC patch.

So fix is something like:

1) Add "int rt_route_iif;" to struct rtable

2) For input routes, always set rt_route_iif to same value as rt_iif

3) For output routes, always set rt_route_iif to zero.  Set rt_iif
   as it is done currently.

4) Change rt_is_{output,input}_route() to test rt_route_iif

This should fix the bug and not introduce new regressions.

Can you write and test such a patch with your test case?

Thank you!

  reply	other threads:[~2011-04-07  5:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-05 13:05 problem of "ipv4: revert Set rt->rt_iif more sanely on output routes." OGAWA Hirofumi
2011-04-05 14:11 ` OGAWA Hirofumi
2011-04-05 14:57   ` OGAWA Hirofumi
2011-04-06 20:28 ` David Miller
2011-04-07  4:31   ` OGAWA Hirofumi
2011-04-07  5:34     ` David Miller
2011-04-07  5:42       ` David Miller [this message]
2011-04-07  7:19         ` OGAWA Hirofumi
2011-04-07  8:29           ` OGAWA Hirofumi
2011-04-07  8:32             ` OGAWA Hirofumi
2011-04-07 20:58               ` David Miller
2011-04-07 21:03             ` David Miller

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=20110406.224244.104071339.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=hirofumi@mail.parknet.co.jp \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).