diff options
author | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2006-08-23 20:18:57 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-09-22 17:55:43 -0400 |
commit | af184765848c280c7e6190f45c827c5ea3881126 (patch) | |
tree | 82d6515825c9679ac5140ec635b4a12fef71ad03 /net | |
parent | a6279458c534d01ccc39498aba61c93083ee0372 (diff) |
[IPV6] NDISC: Initialize fl with outbound interface to lookup rules properly.
Based on MIPL2 kernel patch.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: Ville Nuorvala <vnuorval@tcs.hut.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv6/ndisc.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c index 32f28dec399e..ed01f9a330d6 100644 --- a/net/ipv6/ndisc.c +++ b/net/ipv6/ndisc.c | |||
@@ -412,7 +412,8 @@ static void pndisc_destructor(struct pneigh_entry *n) | |||
412 | */ | 412 | */ |
413 | 413 | ||
414 | static inline void ndisc_flow_init(struct flowi *fl, u8 type, | 414 | static inline void ndisc_flow_init(struct flowi *fl, u8 type, |
415 | struct in6_addr *saddr, struct in6_addr *daddr) | 415 | struct in6_addr *saddr, struct in6_addr *daddr, |
416 | int oif) | ||
416 | { | 417 | { |
417 | memset(fl, 0, sizeof(*fl)); | 418 | memset(fl, 0, sizeof(*fl)); |
418 | ipv6_addr_copy(&fl->fl6_src, saddr); | 419 | ipv6_addr_copy(&fl->fl6_src, saddr); |
@@ -420,6 +421,7 @@ static inline void ndisc_flow_init(struct flowi *fl, u8 type, | |||
420 | fl->proto = IPPROTO_ICMPV6; | 421 | fl->proto = IPPROTO_ICMPV6; |
421 | fl->fl_icmp_type = type; | 422 | fl->fl_icmp_type = type; |
422 | fl->fl_icmp_code = 0; | 423 | fl->fl_icmp_code = 0; |
424 | fl->oif = oif; | ||
423 | security_sk_classify_flow(ndisc_socket->sk, fl); | 425 | security_sk_classify_flow(ndisc_socket->sk, fl); |
424 | } | 426 | } |
425 | 427 | ||
@@ -452,7 +454,8 @@ static void ndisc_send_na(struct net_device *dev, struct neighbour *neigh, | |||
452 | src_addr = &tmpaddr; | 454 | src_addr = &tmpaddr; |
453 | } | 455 | } |
454 | 456 | ||
455 | ndisc_flow_init(&fl, NDISC_NEIGHBOUR_ADVERTISEMENT, src_addr, daddr); | 457 | ndisc_flow_init(&fl, NDISC_NEIGHBOUR_ADVERTISEMENT, src_addr, daddr, |
458 | dev->ifindex); | ||
456 | 459 | ||
457 | dst = ndisc_dst_alloc(dev, neigh, daddr, ip6_output); | 460 | dst = ndisc_dst_alloc(dev, neigh, daddr, ip6_output); |
458 | if (!dst) | 461 | if (!dst) |
@@ -542,7 +545,8 @@ void ndisc_send_ns(struct net_device *dev, struct neighbour *neigh, | |||
542 | saddr = &addr_buf; | 545 | saddr = &addr_buf; |
543 | } | 546 | } |
544 | 547 | ||
545 | ndisc_flow_init(&fl, NDISC_NEIGHBOUR_SOLICITATION, saddr, daddr); | 548 | ndisc_flow_init(&fl, NDISC_NEIGHBOUR_SOLICITATION, saddr, daddr, |
549 | dev->ifindex); | ||
546 | 550 | ||
547 | dst = ndisc_dst_alloc(dev, neigh, daddr, ip6_output); | 551 | dst = ndisc_dst_alloc(dev, neigh, daddr, ip6_output); |
548 | if (!dst) | 552 | if (!dst) |
@@ -617,7 +621,8 @@ void ndisc_send_rs(struct net_device *dev, struct in6_addr *saddr, | |||
617 | int len; | 621 | int len; |
618 | int err; | 622 | int err; |
619 | 623 | ||
620 | ndisc_flow_init(&fl, NDISC_ROUTER_SOLICITATION, saddr, daddr); | 624 | ndisc_flow_init(&fl, NDISC_ROUTER_SOLICITATION, saddr, daddr, |
625 | dev->ifindex); | ||
621 | 626 | ||
622 | dst = ndisc_dst_alloc(dev, NULL, daddr, ip6_output); | 627 | dst = ndisc_dst_alloc(dev, NULL, daddr, ip6_output); |
623 | if (!dst) | 628 | if (!dst) |
@@ -1383,7 +1388,8 @@ void ndisc_send_redirect(struct sk_buff *skb, struct neighbour *neigh, | |||
1383 | return; | 1388 | return; |
1384 | } | 1389 | } |
1385 | 1390 | ||
1386 | ndisc_flow_init(&fl, NDISC_REDIRECT, &saddr_buf, &skb->nh.ipv6h->saddr); | 1391 | ndisc_flow_init(&fl, NDISC_REDIRECT, &saddr_buf, &skb->nh.ipv6h->saddr, |
1392 | dev->ifindex); | ||
1387 | 1393 | ||
1388 | dst = ip6_route_output(NULL, &fl); | 1394 | dst = ip6_route_output(NULL, &fl); |
1389 | if (dst == NULL) | 1395 | if (dst == NULL) |