netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Maciej Żenczykowski" <zenczykowski@gmail.com>
To: hadi@cyberus.ca
Cc: Rob.Townley@gmail.com,
	YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>,
	netdev@vger.kernel.org
Subject: Re: [PATCH] iputils: ping by mark
Date: Sat, 17 Oct 2009 18:46:11 -0700	[thread overview]
Message-ID: <55a4f86e0910171846w45dda0e9w86f570b087c1543d@mail.gmail.com> (raw)
In-Reply-To: <1255822485.4815.15.camel@dogo.mojatatu.com>

Try it with a udp packet or a tcp connection - so_mark and ip rule
fwmark only work for raw sockets (and maybe some other special cases),
unless you're lucky and the ip(6)tables mangle module just happens to
rerun the routing decision (because it mangles the packet in some
other way...).

The problem is that the SO_MARK mark is not used for the initial
routing decision for most protocols (it _is_ used for raw sockets).
There have been a few patches lately from atis@mikrotik.com that have
fixed some of the outstanding problems.
I have not had the opportunity to take a look at the current state of
the breakage.

2009/10/17 jamal <hadi@cyberus.ca>:
> On Sat, 2009-10-17 at 19:04 -0400, jamal wrote:
>
>> This patch has worked fine in
>> 2.6.31 and pre-31 where i tested.
>
> Ok, just to be sure - here's a simple test i just did on my laptop...
>
> ------
> hadi@dogo:~$ uname -a
> Linux dogo 2.6.31-rc7-00001-g6da17c5-dirty #7 PREEMPT Thu Oct 15
> 16:35:13 EDT 2009 i686 GNU/Linux
> hadi@dogo:~$ ip a ls dev eth0
> 11: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast
> state UNKNOWN qlen 1000
>    link/ether 00:0b:97:97:4d:6a brd ff:ff:ff:ff:ff:ff
>    inet 10.0.0.31/24 brd 10.0.0.255 scope global eth0
>    inet 10.0.0.2/32 scope global eth0
>    inet6 fe80::20b:97ff:fe97:4d6a/64 scope link
>       valid_lft forever preferred_lft forever
> hadi@dogo:~$ ip ru ls
> 0:      from all lookup local
> 15:     from all fwmark 0xf lookup 15
> 16:     from all fwmark 0x10 lookup 16
> 32766:  from all lookup main
> 32767:  from all lookup default
>
> hadi@dogo:~$ ip r ls table 15
> 208.67.217.231 via 10.0.0.1 dev eth0  src 10.0.0.31
> hadi@dogo:~$ ip r ls table 16
> 208.67.217.231 via 10.0.0.1 dev eth0  src 10.0.0.2
> hadi@dogo:~$
>
> One ping with -m 15 -c1 to 208.67.217.231, tcpdump:
> 19:22:09.467555 IP 10.0.0.31 > 208.67.217.231: ICMP echo request, id
> 34328, seq 1, length 64
> 19:22:09.535429 IP 208.67.217.231 > 10.0.0.31: ICMP echo reply, id
> 34328, seq 1, length 64
>
> repeat ping with -m 16 and watch tcpdump
> 19:23:19.731592 IP 10.0.0.2 > 208.67.217.231: ICMP echo request, id
> 50712, seq 1, length 64
> 19:23:19.790672 IP 208.67.217.231 > 10.0.0.2: ICMP echo reply, id 50712,
> seq 1, length 64
>
> ------
>
>
> I have also tried it with udp (hacked netcat) and i dont see any problem
> either
>
> What did i miss?
>
> cheers,
> jamal
>
>

  reply	other threads:[~2009-10-18  1:46 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-12 21:05 [PATCH] iputils: ping by mark jamal
2009-10-16 21:05 ` Rob Townley
2009-10-17 12:30   ` jamal
2009-10-17 18:54     ` Maciej Żenczykowski
2009-10-17 23:04       ` jamal
2009-10-17 23:34         ` jamal
2009-10-18  1:46           ` Maciej Żenczykowski [this message]
2009-10-18 11:37             ` jamal
2009-10-18 22:57               ` Maciej Żenczykowski
  -- strict thread matches above, loose matches on Subject: below --
2010-02-13 15:25 jamal
2010-02-13 15:38 ` YOSHIFUJI Hideaki
2010-02-13 15:47 ` YOSHIFUJI Hideaki
2010-02-13 16:21   ` jamal
2010-02-13 17:35     ` YOSHIFUJI Hideaki

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=55a4f86e0910171846w45dda0e9w86f570b087c1543d@mail.gmail.com \
    --to=zenczykowski@gmail.com \
    --cc=Rob.Townley@gmail.com \
    --cc=hadi@cyberus.ca \
    --cc=netdev@vger.kernel.org \
    --cc=yoshfuji@linux-ipv6.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).