Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1388303 > unrolled thread

[PATCH 3.2 094/115] ipv6/udp: use sticky pktinfo egress ifindex on connect()

Started byBen Hutchings <ben@decadent.org.uk>
First post2016-04-27 01:30 +0200
Last post2016-04-27 01:30 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 3.2 094/115] ipv6/udp: use sticky pktinfo egress ifindex  on  connect() Ben Hutchings <ben@decadent.org.uk> - 2016-04-27 01:30 +0200

#1388303 — [PATCH 3.2 094/115] ipv6/udp: use sticky pktinfo egress ifindex on connect()

FromBen Hutchings <ben@decadent.org.uk>
Date2016-04-27 01:30 +0200
Subject[PATCH 3.2 094/115] ipv6/udp: use sticky pktinfo egress ifindex on connect()
Message-ID<rskAC-7Vw-133@gated-at.bofh.it>
3.2.80-rc1 review patch.  If anyone has any objections, please let me know.

------------------

From: Paolo Abeni <pabeni@redhat.com>

[ Upstream commit 1cdda91871470f15e79375991bd2eddc6e86ddb1 ]

Currently, the egress interface index specified via IPV6_PKTINFO
is ignored by __ip6_datagram_connect(), so that RFC 3542 section 6.7
can be subverted when the user space application calls connect()
before sendmsg().
Fix it by initializing properly flowi6_oif in connect() before
performing the route lookup.

Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 net/ipv6/datagram.c | 3 +++
 1 file changed, 3 insertions(+)

--- a/net/ipv6/datagram.c
+++ b/net/ipv6/datagram.c
@@ -161,6 +161,9 @@ ipv4_connected:
 	fl6.fl6_dport = inet->inet_dport;
 	fl6.fl6_sport = inet->inet_sport;
 
+	if (!fl6.flowi6_oif)
+		fl6.flowi6_oif = np->sticky_pktinfo.ipi6_ifindex;
+
 	if (!fl6.flowi6_oif && (addr_type&IPV6_ADDR_MULTICAST))
 		fl6.flowi6_oif = np->mcast_oif;
 

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web