Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 6244
b: refs/heads/master
c: 0bd1b59
h: refs/heads/master
v: v3
  • Loading branch information
Andrew McDonald authored and David S. Miller committed Aug 29, 2005
1 parent 32c3052 commit 8e29498
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7af4cc3fa158ff1dda6e7451c7e6afa6b0bb85cb
refs/heads/master: 0bd1b59b15e4057101c89d4db15a3683c0d897f7
3 changes: 2 additions & 1 deletion trunk/include/net/rawv6.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ extern rwlock_t raw_v6_lock;
extern void ipv6_raw_deliver(struct sk_buff *skb, int nexthdr);

extern struct sock *__raw_v6_lookup(struct sock *sk, unsigned short num,
struct in6_addr *loc_addr, struct in6_addr *rmt_addr);
struct in6_addr *loc_addr, struct in6_addr *rmt_addr,
int dif);

extern int rawv6_rcv(struct sock *sk,
struct sk_buff *skb);
Expand Down
3 changes: 2 additions & 1 deletion trunk/net/ipv6/icmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,8 @@ static void icmpv6_notify(struct sk_buff *skb, int type, int code, u32 info)

read_lock(&raw_v6_lock);
if ((sk = sk_head(&raw_v6_htable[hash])) != NULL) {
while((sk = __raw_v6_lookup(sk, nexthdr, daddr, saddr))) {
while((sk = __raw_v6_lookup(sk, nexthdr, daddr, saddr,
skb->dev->ifindex))) {
rawv6_err(sk, skb, NULL, type, code, inner_offset, info);
sk = sk_next(sk);
}
Expand Down
4 changes: 3 additions & 1 deletion trunk/net/ipv6/ip6_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,9 @@ static int ip6_call_ra_chain(struct sk_buff *skb, int sel)
read_lock(&ip6_ra_lock);
for (ra = ip6_ra_chain; ra; ra = ra->next) {
struct sock *sk = ra->sk;
if (sk && ra->sel == sel) {
if (sk && ra->sel == sel &&
(!sk->sk_bound_dev_if ||
sk->sk_bound_dev_if == skb->dev->ifindex)) {
if (last) {
struct sk_buff *skb2 = skb_clone(skb, GFP_ATOMIC);
if (skb2)
Expand Down
11 changes: 8 additions & 3 deletions trunk/net/ipv6/raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ static void raw_v6_unhash(struct sock *sk)

/* Grumble... icmp and ip_input want to get at this... */
struct sock *__raw_v6_lookup(struct sock *sk, unsigned short num,
struct in6_addr *loc_addr, struct in6_addr *rmt_addr)
struct in6_addr *loc_addr, struct in6_addr *rmt_addr,
int dif)
{
struct hlist_node *node;
int is_multicast = ipv6_addr_is_multicast(loc_addr);
Expand All @@ -94,6 +95,9 @@ struct sock *__raw_v6_lookup(struct sock *sk, unsigned short num,
!ipv6_addr_equal(&np->daddr, rmt_addr))
continue;

if (sk->sk_bound_dev_if && sk->sk_bound_dev_if != dif)
continue;

if (!ipv6_addr_any(&np->rcv_saddr)) {
if (ipv6_addr_equal(&np->rcv_saddr, loc_addr))
goto found;
Expand Down Expand Up @@ -160,7 +164,7 @@ void ipv6_raw_deliver(struct sk_buff *skb, int nexthdr)
if (sk == NULL)
goto out;

sk = __raw_v6_lookup(sk, nexthdr, daddr, saddr);
sk = __raw_v6_lookup(sk, nexthdr, daddr, saddr, skb->dev->ifindex);

while (sk) {
if (nexthdr != IPPROTO_ICMPV6 || !icmpv6_filter(sk, skb)) {
Expand All @@ -170,7 +174,8 @@ void ipv6_raw_deliver(struct sk_buff *skb, int nexthdr)
if (clone)
rawv6_rcv(sk, clone);
}
sk = __raw_v6_lookup(sk_next(sk), nexthdr, daddr, saddr);
sk = __raw_v6_lookup(sk_next(sk), nexthdr, daddr, saddr,
skb->dev->ifindex);
}
out:
read_unlock(&raw_v6_lock);
Expand Down

0 comments on commit 8e29498

Please sign in to comment.