From: Patrick McHardy <kaber@trash.net>
To: laszlo@balabit.hu, attila@balabit.hu, Toth <panther@balabit.hu>
Cc: Netfilter Developer Mailing List
<netfilter-devel@vger.kernel.org>,
Laszlo Attila Toth <panther@balabit.hu>
Subject: Re: [PATCH] Introducing socket mark socket option
Date: Tue, 22 Jan 2008 15:38:38 +0100 [thread overview]
Message-ID: <4795FFEE.8070400@trash.net> (raw)
In-Reply-To: <12010124971855-git-send-email->
laszlo@balabit.hu wrote:
> From: Laszlo Attila Toth <panther@balabit.hu>
>
> If netfilter is enabled, a userspace program may wish to set the mark for
> each packets its send instead of using the MARK target.
Looks reasonable, but please CC netdev and linux-arch.
> diff --git a/include/net/route.h b/include/net/route.h
> index 5847e6f..70792e3 100644
> --- a/include/net/route.h
> +++ b/include/net/route.h
> @@ -27,6 +27,7 @@
> #include <net/dst.h>
> #include <net/inetpeer.h>
> #include <net/flow.h>
> +#include <net/sock.h>
> #include <linux/in_route.h>
> #include <linux/rtnetlink.h>
> #include <linux/route.h>
> @@ -148,9 +149,13 @@ static inline int ip_route_connect(struct rtable **rp, __be32 dst,
> int flags)
> {
> struct flowi fl = { .oif = oif,
> +#ifdef CONFIG_NETFILTER
> + .mark = sk->sk_mark,
> +#endif
Formatting is slightly inconsistent, but more importantly the mark
doesn't depend on CONFIG_NETFILTER anymore.
> .nl_u = { .ip4_u = { .daddr = dst,
> .saddr = src,
> - .tos = tos } },
> + .tos = tos,
> + } },
> .proto = protocol,
> .uli_u = { .ports =
> { .sport = sport,
> diff --git a/include/net/sock.h b/include/net/sock.h
> index 9023244..8e88a0e 100644
> --- a/include/net/sock.h
> +++ b/include/net/sock.h
> @@ -252,6 +252,9 @@ struct sock {
> long sk_rcvtimeo;
> long sk_sndtimeo;
> struct sk_filter *sk_filter;
> +#ifdef CONFIG_NETFILTER
> + __u32 sk_mark;
> +#endif
Please find a spot that doesn't add holes on 64 bit.
> void *sk_protinfo;
next parent reply other threads:[~2008-01-22 14:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <12010124971855-git-send-email->
2008-01-22 14:38 ` Patrick McHardy [this message]
2008-01-23 9:05 ` [PATCH] Introducing socket mark socket option Laszlo Attila Toth
2008-01-23 12:40 Laszlo Attila Toth
2008-01-23 14:19 ` Patrick McHardy
-- strict thread matches above, loose matches on Subject: below --
2008-01-22 14:34 laszlo, attila, Toth <panther
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=4795FFEE.8070400@trash.net \
--to=kaber@trash.net \
--cc=attila@balabit.hu \
--cc=laszlo@balabit.hu \
--cc=netfilter-devel@vger.kernel.org \
--cc=panther@balabit.hu \
/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.