Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 54981279 authored by Rafael Laufer's avatar Rafael Laufer Committed by Patrick McHardy
Browse files

netfilter: nf_conntrack: add SCTP support for SO_ORIGINAL_DST



Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
parent bbd8a0d3
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -256,11 +256,11 @@ getorigdst(struct sock *sk, int optval, void __user *user, int *len)
	tuple.dst.u3.ip = inet->daddr;
	tuple.dst.u3.ip = inet->daddr;
	tuple.dst.u.tcp.port = inet->dport;
	tuple.dst.u.tcp.port = inet->dport;
	tuple.src.l3num = PF_INET;
	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? */
	/* We only do TCP and SCTP at the moment: is there a better way? */
	if (strcmp(sk->sk_prot->name, "TCP")) {
	if (sk->sk_protocol != IPPROTO_TCP && sk->sk_protocol != IPPROTO_SCTP) {
		pr_debug("SO_ORIGINAL_DST: Not a TCP socket\n");
		pr_debug("SO_ORIGINAL_DST: Not a TCP/SCTP socket\n");
		return -ENOPROTOOPT;
		return -ENOPROTOOPT;
	}
	}