]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/2.6.18.5/ipv6-fix-address-interface-handling-in-udp-and-dccp-according-to-the-scoping-architecture.patch
3.18-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 2.6.18.5 / ipv6-fix-address-interface-handling-in-udp-and-dccp-according-to-the-scoping-architecture.patch
CommitLineData
43910b3c
CW
1From stable-bounces@linux.kernel.org Thu Nov 23 18:10:52 2006
2From: maks@sternwelten.at
3Date: Wed, 22 Nov 2006 02:59:09 GMT
4Message-Id: <200611220259.kAM2x9xc004965@hera.kernel.org>
5To: stable@kernel.org
6Subject: IPV6: Fix address/interface handling in UDP and DCCP, according to the scoping architecture.
7
8From: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
9
10TCP and RAW do not have this issue. Closes Bug #7432.
11
12Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
13Signed-off-by: David S. Miller <davem@davemloft.net>
14Signed-off-by: Chris Wright <chrisw@sous-sol.org>
15---
16
17 net/dccp/ipv6.c | 2 +-
18 net/ipv6/udp.c | 7 +++----
19 2 files changed, 4 insertions(+), 5 deletions(-)
20
c4559b24
CW
21--- linux-2.6.18.4.orig/net/dccp/ipv6.c
22+++ linux-2.6.18.4/net/dccp/ipv6.c
43910b3c
CW
23@@ -276,7 +276,7 @@ static void dccp_v6_err(struct sk_buff *
24 __u64 seq;
25
26 sk = inet6_lookup(&dccp_hashinfo, &hdr->daddr, dh->dccph_dport,
27- &hdr->saddr, dh->dccph_sport, skb->dev->ifindex);
28+ &hdr->saddr, dh->dccph_sport, inet6_iif(skb));
29
30 if (sk == NULL) {
31 ICMP6_INC_STATS_BH(__in6_dev_get(skb->dev), ICMP6_MIB_INERRORS);
c4559b24
CW
32--- linux-2.6.18.4.orig/net/ipv6/udp.c
33+++ linux-2.6.18.4/net/ipv6/udp.c
43910b3c
CW
34@@ -314,14 +314,13 @@ static void udpv6_err(struct sk_buff *sk
35 {
36 struct ipv6_pinfo *np;
37 struct ipv6hdr *hdr = (struct ipv6hdr*)skb->data;
38- struct net_device *dev = skb->dev;
39 struct in6_addr *saddr = &hdr->saddr;
40 struct in6_addr *daddr = &hdr->daddr;
41 struct udphdr *uh = (struct udphdr*)(skb->data+offset);
42 struct sock *sk;
43 int err;
44
45- sk = udp_v6_lookup(daddr, uh->dest, saddr, uh->source, dev->ifindex);
46+ sk = udp_v6_lookup(daddr, uh->dest, saddr, uh->source, inet6_iif(skb));
47
48 if (sk == NULL)
49 return;
50@@ -415,7 +414,7 @@ static void udpv6_mcast_deliver(struct u
51
52 read_lock(&udp_hash_lock);
53 sk = sk_head(&udp_hash[ntohs(uh->dest) & (UDP_HTABLE_SIZE - 1)]);
54- dif = skb->dev->ifindex;
55+ dif = inet6_iif(skb);
56 sk = udp_v6_mcast_next(sk, uh->dest, daddr, uh->source, saddr, dif);
57 if (!sk) {
58 kfree_skb(skb);
59@@ -496,7 +495,7 @@ static int udpv6_rcv(struct sk_buff **ps
60 * check socket cache ... must talk to Alan about his plans
61 * for sock caches... i'll skip this for now.
62 */
63- sk = udp_v6_lookup(saddr, uh->source, daddr, uh->dest, dev->ifindex);
64+ sk = udp_v6_lookup(saddr, uh->source, daddr, uh->dest, inet6_iif(skb));
65
66 if (sk == NULL) {
67 if (!xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb))