Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a1921443 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6:
  netns: Don't receive new packets in a dead network namespace.
  sctp: Make sure N * sizeof(union sctp_addr) does not overflow.
  pppoe: warning fix
  ipv6: Drop packets for loopback address from outside of the box.
  ipv6: Remove options header when setsockopt's optlen is 0
  mac80211: detect driver tx bugs
parents b732d968 b9f75f45
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -942,7 +942,7 @@ static int pppoe_recvmsg(struct kiocb *iocb, struct socket *sock,
	m->msg_namelen = 0;

	if (skb) {
		total_len = min(total_len, skb->len);
		total_len = min_t(size_t, total_len, skb->len);
		error = skb_copy_datagram_iovec(skb, 0, m->msg_iov, total_len);
		if (error == 0)
			error = total_len;
+6 −0
Original line number Diff line number Diff line
@@ -367,6 +367,12 @@ static inline int ipv6_addr_any(const struct in6_addr *a)
		 a->s6_addr32[2] | a->s6_addr32[3] ) == 0); 
}

static inline int ipv6_addr_loopback(const struct in6_addr *a)
{
	return ((a->s6_addr32[0] | a->s6_addr32[1] |
		 a->s6_addr32[2] | (a->s6_addr32[3] ^ htonl(1))) == 0);
}

static inline int ipv6_addr_v4mapped(const struct in6_addr *a)
{
	return ((a->s6_addr32[0] | a->s6_addr32[1] |
+11 −0
Original line number Diff line number Diff line
@@ -95,6 +95,11 @@ extern struct list_head net_namespace_list;
#ifdef CONFIG_NET_NS
extern void __put_net(struct net *net);

static inline int net_alive(struct net *net)
{
	return net && atomic_read(&net->count);
}

static inline struct net *get_net(struct net *net)
{
	atomic_inc(&net->count);
@@ -125,6 +130,12 @@ int net_eq(const struct net *net1, const struct net *net2)
	return net1 == net2;
}
#else

static inline int net_alive(struct net *net)
{
	return 1;
}

static inline struct net *get_net(struct net *net)
{
	return net;
+4 −0
Original line number Diff line number Diff line
@@ -2077,6 +2077,10 @@ int netif_receive_skb(struct sk_buff *skb)

	rcu_read_lock();

	/* Don't receive packets in an exiting network namespace */
	if (!net_alive(dev_net(skb->dev)))
		goto out;

#ifdef CONFIG_NET_CLS_ACT
	if (skb->tc_verd & TC_NCLS) {
		skb->tc_verd = CLR_TC_NCLS(skb->tc_verd);
+3 −0
Original line number Diff line number Diff line
@@ -140,6 +140,9 @@ static void cleanup_net(struct work_struct *work)
	struct pernet_operations *ops;
	struct net *net;

	/* Be very certain incoming network packets will not find us */
	rcu_barrier();

	net = container_of(work, struct net, work);

	mutex_lock(&net_mutex);
Loading