diff options
author | Jon Paul Maloy <jon.maloy@ericsson.com> | 2016-08-16 11:53:50 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-08-18 21:14:36 -0700 |
commit | 0d051bf93c0640483788db56dfc118d307f8893b (patch) | |
tree | 360722c2eae3e17cb4801e1dc8f14aeb91437284 /net/tipc/udp_media.c | |
parent | 37bd91d1d9a9a3ab5e8f7efedadc4ced5d2d0a3a (diff) |
tipc: make bearer packet filtering generic
In commit 5b7066c3dd24 ("tipc: stricter filtering of packets in bearer
layer") we introduced a method of filtering out messages while a bearer
is being reset, to avoid that links may be re-created and come back in
working state while we are still in the process of shutting them down.
This solution works well, but is limited to only work with L2 media, which
is insufficient with the increasing use of UDP as carrier media.
We now replace this solution with a more generic one, by introducing a
new flag "up" in the generic struct tipc_bearer. This field will be set
and reset at the same locations as with the previous solution, while
the packet filtering is moved to the generic code for the sending side.
On the receiving side, the filtering is still done in media specific
code, but now including the UDP bearer.
Acked-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/udp_media.c')
-rw-r--r-- | net/tipc/udp_media.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/tipc/udp_media.c b/net/tipc/udp_media.c index b016c011970b..33bdf5449a5e 100644 --- a/net/tipc/udp_media.c +++ b/net/tipc/udp_media.c @@ -224,7 +224,7 @@ static int tipc_udp_recv(struct sock *sk, struct sk_buff *skb) rcu_read_lock(); b = rcu_dereference_rtnl(ub->bearer); - if (b) { + if (b && test_bit(0, &b->up)) { tipc_rcv(sock_net(sk), skb, b); rcu_read_unlock(); return 0; |