Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 122583
b: refs/heads/master
c: a21f3f9
h: refs/heads/master
i:
  122581: ec6f2b3
  122579: ce52d4f
  122575: ac5cceb
v: v3
  • Loading branch information
Benjamin Thery authored and David S. Miller committed Dec 11, 2008
1 parent e3d7964 commit 5166678
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 17 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: 4045e57c19bee150370390545ee8a933b3f7a18d
refs/heads/master: a21f3f997c73ced682129aedd372bb6b53041510
2 changes: 2 additions & 0 deletions trunk/include/net/netns/ipv6.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ struct netns_ipv6 {
struct mif_device *vif6_table;
int maxvif;
atomic_t cache_resolve_queue_len;
int mroute_do_assert;
int mroute_do_pim;
#endif
};
#endif
26 changes: 10 additions & 16 deletions trunk/net/ipv6/ip6mr.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,6 @@ static DEFINE_RWLOCK(mrt_lock);

#define MIF_EXISTS(_net, _idx) ((_net)->ipv6.vif6_table[_idx].dev != NULL)

static int mroute_do_assert; /* Set in PIM assert */
#ifdef CONFIG_IPV6_PIMSM_V2
static int mroute_do_pim;
#else
#define mroute_do_pim 0
#endif

static struct mfc6_cache *mfc_unres_queue; /* Queue of unresolved entries */

/* Special spinlock for queue of unresolved entries */
Expand Down Expand Up @@ -1306,7 +1299,7 @@ int ip6_mroute_setsockopt(struct sock *sk, int optname, char __user *optval, int
int v;
if (get_user(v, (int __user *)optval))
return -EFAULT;
mroute_do_assert = !!v;
init_net.ipv6.mroute_do_assert = !!v;
return 0;
}

Expand All @@ -1319,10 +1312,10 @@ int ip6_mroute_setsockopt(struct sock *sk, int optname, char __user *optval, int
v = !!v;
rtnl_lock();
ret = 0;
if (v != mroute_do_pim) {
mroute_do_pim = v;
mroute_do_assert = v;
if (mroute_do_pim)
if (v != init_net.ipv6.mroute_do_pim) {
init_net.ipv6.mroute_do_pim = v;
init_net.ipv6.mroute_do_assert = v;
if (init_net.ipv6.mroute_do_pim)
ret = inet6_add_protocol(&pim6_protocol,
IPPROTO_PIM);
else
Expand Down Expand Up @@ -1361,11 +1354,11 @@ int ip6_mroute_getsockopt(struct sock *sk, int optname, char __user *optval,
break;
#ifdef CONFIG_IPV6_PIMSM_V2
case MRT6_PIM:
val = mroute_do_pim;
val = init_net.ipv6.mroute_do_pim;
break;
#endif
case MRT6_ASSERT:
val = mroute_do_assert;
val = init_net.ipv6.mroute_do_assert;
break;
default:
return -ENOPROTOOPT;
Expand Down Expand Up @@ -1553,13 +1546,14 @@ static int ip6_mr_forward(struct sk_buff *skb, struct mfc6_cache *cache)
cache->mfc_un.res.wrong_if++;
true_vifi = ip6mr_find_vif(skb->dev);

if (true_vifi >= 0 && mroute_do_assert &&
if (true_vifi >= 0 && init_net.ipv6.mroute_do_assert &&
/* pimsm uses asserts, when switching from RPT to SPT,
so that we cannot check that packet arrived on an oif.
It is bad, but otherwise we would need to move pretty
large chunk of pimd to kernel. Ough... --ANK
*/
(mroute_do_pim || cache->mfc_un.res.ttls[true_vifi] < 255) &&
(init_net.ipv6.mroute_do_pim ||
cache->mfc_un.res.ttls[true_vifi] < 255) &&
time_after(jiffies,
cache->mfc_un.res.last_assert + MFC_ASSERT_THRESH)) {
cache->mfc_un.res.last_assert = jiffies;
Expand Down

0 comments on commit 5166678

Please sign in to comment.