From: Rafael Laufer <rlaufer@cs.ucla.edu>
To: David Miller <davem@davemloft.net>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH] SO_ORIGINAL_DST for getsockopt() in SCTP
Date: Thu, 02 Jul 2009 19:26:57 -0700 [thread overview]
Message-ID: <4A4D6C71.5080005@cs.ucla.edu> (raw)
In-Reply-To: <20090702.184033.127910800.davem@davemloft.net>
David Miller wrote:
> Thunderbird has severely mangled your patch beyond usability.
>
> Please read Documentation/email-clients.txt in the kernel sources.
Trying again:
diff -rup linux-2.6.28.orig/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c linux-2.6.28/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
--- linux-2.6.28.orig/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c 2008-12-24 15:26:37.000000000 -0800
+++ linux-2.6.28/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c 2009-07-02 17:07:09.000000000 -0700
@@ -258,11 +258,11 @@ getorigdst(struct sock *sk, int optval,
tuple.dst.u3.ip = inet->daddr;
tuple.dst.u.tcp.port = inet->dport;
tuple.src.l3num = PF_INET;
- tuple.dst.protonum = IPPROTO_TCP;
+ tuple.dst.protonum = sk->sk_protocol;
- /* We only do TCP at the moment: is there a better way? */
- if (strcmp(sk->sk_prot->name, "TCP")) {
- pr_debug("SO_ORIGINAL_DST: Not a TCP socket\n");
+ /* We only do TCP and SCTP at the moment: is there a better way? */
+ if ((sk->sk_protocol != IPPROTO_TCP) && (sk->sk_protocol != IPPROTO_SCTP)) {
+ pr_debug("SO_ORIGINAL_DST: Not a TCP/SCTP socket\n");
return -ENOPROTOOPT;
}
Rafael
next prev parent reply other threads:[~2009-07-03 2:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-03 0:26 [PATCH] SO_ORIGINAL_DST for getsockopt() in SCTP Rafael Laufer
2009-07-03 1:40 ` David Miller
2009-07-03 2:26 ` Rafael Laufer [this message]
2009-07-03 3:01 ` David Miller
2009-08-10 8:09 ` 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=4A4D6C71.5080005@cs.ucla.edu \
--to=rlaufer@cs.ucla.edu \
--cc=davem@davemloft.net \
--cc=netfilter-devel@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.