aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2010-04-27 15:49:13 -0400
committerDavid S. Miller <davem@davemloft.net>2010-04-27 15:49:13 -0400
commite1703b36c358dde24ececba4fd609ecd91433ba3 (patch)
treed59c333d0ad5bf72f165264eba6048c87fdc4e0f /net
parent7ec75c582e639d956ce3afd499f67febe6f902a4 (diff)
parente95ef5d3f6bc60433883e1ef65dac747acd0bf1a (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts: drivers/net/e100.c drivers/net/e1000e/netdev.c
Diffstat (limited to 'net')
-rw-r--r--net/core/rtnetlink.c5
-rw-r--r--net/ieee802154/af_ieee802154.c3
-rw-r--r--net/ipv4/inet_connection_sock.c16
-rw-r--r--net/ipv6/inet6_connection_sock.c15
-rw-r--r--net/ipv6/ip6_output.c2
-rw-r--r--net/ipv6/route.c2
-rw-r--r--net/ipv6/xfrm6_policy.c2
-rw-r--r--net/rds/rdma_transport.c2
-rw-r--r--net/x25/af_x25.c1
9 files changed, 32 insertions, 16 deletions
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 78c85985cb30..455e35aefbc2 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -1319,10 +1319,11 @@ replay:
1319 err = ops->newlink(net, dev, tb, data); 1319 err = ops->newlink(net, dev, tb, data);
1320 else 1320 else
1321 err = register_netdevice(dev); 1321 err = register_netdevice(dev);
1322 if (err < 0 && !IS_ERR(dev)) { 1322
1323 if (err < 0 && !IS_ERR(dev))
1323 free_netdev(dev); 1324 free_netdev(dev);
1325 if (err < 0)
1324 goto out; 1326 goto out;
1325 }
1326 1327
1327 err = rtnl_configure_link(dev, ifm); 1328 err = rtnl_configure_link(dev, ifm);
1328 if (err < 0) 1329 if (err < 0)
diff --git a/net/ieee802154/af_ieee802154.c b/net/ieee802154/af_ieee802154.c
index c7da600750bb..93c91b633a56 100644
--- a/net/ieee802154/af_ieee802154.c
+++ b/net/ieee802154/af_ieee802154.c
@@ -151,6 +151,9 @@ static int ieee802154_dev_ioctl(struct sock *sk, struct ifreq __user *arg,
151 dev_load(sock_net(sk), ifr.ifr_name); 151 dev_load(sock_net(sk), ifr.ifr_name);
152 dev = dev_get_by_name(sock_net(sk), ifr.ifr_name); 152 dev = dev_get_by_name(sock_net(sk), ifr.ifr_name);
153 153
154 if (!dev)
155 return -ENODEV;
156
154 if (dev->type == ARPHRD_IEEE802154 && dev->netdev_ops->ndo_do_ioctl) 157 if (dev->type == ARPHRD_IEEE802154 && dev->netdev_ops->ndo_do_ioctl)
155 ret = dev->netdev_ops->ndo_do_ioctl(dev, &ifr, cmd); 158 ret = dev->netdev_ops->ndo_do_ioctl(dev, &ifr, cmd);
156 159
diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c
index e0a3e3537b14..78cbc39f56c4 100644
--- a/net/ipv4/inet_connection_sock.c
+++ b/net/ipv4/inet_connection_sock.c
@@ -70,13 +70,17 @@ int inet_csk_bind_conflict(const struct sock *sk,
70 (!sk->sk_bound_dev_if || 70 (!sk->sk_bound_dev_if ||
71 !sk2->sk_bound_dev_if || 71 !sk2->sk_bound_dev_if ||
72 sk->sk_bound_dev_if == sk2->sk_bound_dev_if)) { 72 sk->sk_bound_dev_if == sk2->sk_bound_dev_if)) {
73 const __be32 sk2_rcv_saddr = inet_rcv_saddr(sk2);
74
73 if (!reuse || !sk2->sk_reuse || 75 if (!reuse || !sk2->sk_reuse ||
74 sk2->sk_state == TCP_LISTEN) { 76 sk2->sk_state == TCP_LISTEN) {
75 const __be32 sk2_rcv_saddr = inet_rcv_saddr(sk2);
76 if (!sk2_rcv_saddr || !sk_rcv_saddr || 77 if (!sk2_rcv_saddr || !sk_rcv_saddr ||
77 sk2_rcv_saddr == sk_rcv_saddr) 78 sk2_rcv_saddr == sk_rcv_saddr)
78 break; 79 break;
79 } 80 } else if (reuse && sk2->sk_reuse &&
81 sk2_rcv_saddr &&
82 sk2_rcv_saddr == sk_rcv_saddr)
83 break;
80 } 84 }
81 } 85 }
82 return node != NULL; 86 return node != NULL;
@@ -120,9 +124,11 @@ again:
120 smallest_size = tb->num_owners; 124 smallest_size = tb->num_owners;
121 smallest_rover = rover; 125 smallest_rover = rover;
122 if (atomic_read(&hashinfo->bsockets) > (high - low) + 1) { 126 if (atomic_read(&hashinfo->bsockets) > (high - low) + 1) {
123 spin_unlock(&head->lock); 127 if (!inet_csk(sk)->icsk_af_ops->bind_conflict(sk, tb)) {
124 snum = smallest_rover; 128 spin_unlock(&head->lock);
125 goto have_snum; 129 snum = smallest_rover;
130 goto have_snum;
131 }
126 } 132 }
127 } 133 }
128 goto next; 134 goto next;
diff --git a/net/ipv6/inet6_connection_sock.c b/net/ipv6/inet6_connection_sock.c
index 0c5e3c3b7fd5..9ca1efc923a1 100644
--- a/net/ipv6/inet6_connection_sock.c
+++ b/net/ipv6/inet6_connection_sock.c
@@ -42,11 +42,16 @@ int inet6_csk_bind_conflict(const struct sock *sk,
42 if (sk != sk2 && 42 if (sk != sk2 &&
43 (!sk->sk_bound_dev_if || 43 (!sk->sk_bound_dev_if ||
44 !sk2->sk_bound_dev_if || 44 !sk2->sk_bound_dev_if ||
45 sk->sk_bound_dev_if == sk2->sk_bound_dev_if) && 45 sk->sk_bound_dev_if == sk2->sk_bound_dev_if)) {
46 (!sk->sk_reuse || !sk2->sk_reuse || 46 if ((!sk->sk_reuse || !sk2->sk_reuse ||
47 sk2->sk_state == TCP_LISTEN) && 47 sk2->sk_state == TCP_LISTEN) &&
48 ipv6_rcv_saddr_equal(sk, sk2)) 48 ipv6_rcv_saddr_equal(sk, sk2))
49 break; 49 break;
50 else if (sk->sk_reuse && sk2->sk_reuse &&
51 !ipv6_addr_any(inet6_rcv_saddr(sk)) &&
52 ipv6_rcv_saddr_equal(sk, sk2))
53 break;
54 }
50 } 55 }
51 56
52 return node != NULL; 57 return node != NULL;
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index 61e2bef56090..7db09c3f5289 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -625,7 +625,7 @@ static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *))
625 /* We must not fragment if the socket is set to force MTU discovery 625 /* We must not fragment if the socket is set to force MTU discovery
626 * or if the skb it not generated by a local socket. 626 * or if the skb it not generated by a local socket.
627 */ 627 */
628 if (!skb->local_df) { 628 if (!skb->local_df && skb->len > mtu) {
629 skb->dev = skb_dst(skb)->dev; 629 skb->dev = skb_dst(skb)->dev;
630 icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu); 630 icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu);
631 IP6_INC_STATS(net, ip6_dst_idev(skb_dst(skb)), 631 IP6_INC_STATS(net, ip6_dst_idev(skb_dst(skb)),
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index c2438e8cb9d0..05ebd7833043 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -815,7 +815,7 @@ struct dst_entry * ip6_route_output(struct net *net, struct sock *sk,
815{ 815{
816 int flags = 0; 816 int flags = 0;
817 817
818 if (rt6_need_strict(&fl->fl6_dst)) 818 if (fl->oif || rt6_need_strict(&fl->fl6_dst))
819 flags |= RT6_LOOKUP_F_IFACE; 819 flags |= RT6_LOOKUP_F_IFACE;
820 820
821 if (!ipv6_addr_any(&fl->fl6_src)) 821 if (!ipv6_addr_any(&fl->fl6_src))
diff --git a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c
index 8c452fd5ceae..4a0e77e14468 100644
--- a/net/ipv6/xfrm6_policy.c
+++ b/net/ipv6/xfrm6_policy.c
@@ -94,7 +94,7 @@ static int xfrm6_fill_dst(struct xfrm_dst *xdst, struct net_device *dev,
94 xdst->u.dst.dev = dev; 94 xdst->u.dst.dev = dev;
95 dev_hold(dev); 95 dev_hold(dev);
96 96
97 xdst->u.rt6.rt6i_idev = in6_dev_get(rt->u.dst.dev); 97 xdst->u.rt6.rt6i_idev = in6_dev_get(dev);
98 if (!xdst->u.rt6.rt6i_idev) 98 if (!xdst->u.rt6.rt6i_idev)
99 return -ENODEV; 99 return -ENODEV;
100 100
diff --git a/net/rds/rdma_transport.c b/net/rds/rdma_transport.c
index 5ea82fc47c3e..e599ba2f950d 100644
--- a/net/rds/rdma_transport.c
+++ b/net/rds/rdma_transport.c
@@ -133,7 +133,7 @@ static int __init rds_rdma_listen_init(void)
133 ret = PTR_ERR(cm_id); 133 ret = PTR_ERR(cm_id);
134 printk(KERN_ERR "RDS/RDMA: failed to setup listener, " 134 printk(KERN_ERR "RDS/RDMA: failed to setup listener, "
135 "rdma_create_id() returned %d\n", ret); 135 "rdma_create_id() returned %d\n", ret);
136 goto out; 136 return ret;
137 } 137 }
138 138
139 sin.sin_family = AF_INET, 139 sin.sin_family = AF_INET,
diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c
index 6cffbc4da029..296e65e01064 100644
--- a/net/x25/af_x25.c
+++ b/net/x25/af_x25.c
@@ -402,6 +402,7 @@ static void __x25_destroy_socket(struct sock *sk)
402 /* 402 /*
403 * Queue the unaccepted socket for death 403 * Queue the unaccepted socket for death
404 */ 404 */
405 skb->sk->sk_state = TCP_LISTEN;
405 sock_set_flag(skb->sk, SOCK_DEAD); 406 sock_set_flag(skb->sk, SOCK_DEAD);
406 x25_start_heartbeat(skb->sk); 407 x25_start_heartbeat(skb->sk);
407 x25_sk(skb->sk)->state = X25_STATE_0; 408 x25_sk(skb->sk)->state = X25_STATE_0;