diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/Makefile | 4 | ||||
-rw-r--r-- | net/bridge/Kconfig | 1 | ||||
-rw-r--r-- | net/core/dev.c | 12 | ||||
-rw-r--r-- | net/core/pktgen.c | 2 | ||||
-rw-r--r-- | net/ipv4/devinet.c | 6 | ||||
-rw-r--r-- | net/ipv4/ip_gre.c | 2 | ||||
-rw-r--r-- | net/ipv4/ipip.c | 2 | ||||
-rw-r--r-- | net/ipv6/ip6_tunnel.c | 1 | ||||
-rw-r--r-- | net/ipv6/route.c | 4 | ||||
-rw-r--r-- | net/ipv6/sit.c | 2 | ||||
-rw-r--r-- | net/rds/ib_send.c | 5 | ||||
-rw-r--r-- | net/rds/loop.c | 11 | ||||
-rw-r--r-- | net/unix/af_unix.c | 17 |
13 files changed, 48 insertions, 21 deletions
diff --git a/net/Makefile b/net/Makefile index a3330ebe2c53..a51d9465e628 100644 --- a/net/Makefile +++ b/net/Makefile | |||
@@ -19,9 +19,7 @@ obj-$(CONFIG_NETFILTER) += netfilter/ | |||
19 | obj-$(CONFIG_INET) += ipv4/ | 19 | obj-$(CONFIG_INET) += ipv4/ |
20 | obj-$(CONFIG_XFRM) += xfrm/ | 20 | obj-$(CONFIG_XFRM) += xfrm/ |
21 | obj-$(CONFIG_UNIX) += unix/ | 21 | obj-$(CONFIG_UNIX) += unix/ |
22 | ifneq ($(CONFIG_IPV6),) | 22 | obj-$(CONFIG_NET) += ipv6/ |
23 | obj-y += ipv6/ | ||
24 | endif | ||
25 | obj-$(CONFIG_PACKET) += packet/ | 23 | obj-$(CONFIG_PACKET) += packet/ |
26 | obj-$(CONFIG_NET_KEY) += key/ | 24 | obj-$(CONFIG_NET_KEY) += key/ |
27 | obj-$(CONFIG_BRIDGE) += bridge/ | 25 | obj-$(CONFIG_BRIDGE) += bridge/ |
diff --git a/net/bridge/Kconfig b/net/bridge/Kconfig index 9190ae462cb4..6dee7bf648a9 100644 --- a/net/bridge/Kconfig +++ b/net/bridge/Kconfig | |||
@@ -6,6 +6,7 @@ config BRIDGE | |||
6 | tristate "802.1d Ethernet Bridging" | 6 | tristate "802.1d Ethernet Bridging" |
7 | select LLC | 7 | select LLC |
8 | select STP | 8 | select STP |
9 | depends on IPV6 || IPV6=n | ||
9 | ---help--- | 10 | ---help--- |
10 | If you say Y here, then your Linux box will be able to act as an | 11 | If you say Y here, then your Linux box will be able to act as an |
11 | Ethernet bridge, which means that the different Ethernet segments it | 12 | Ethernet bridge, which means that the different Ethernet segments it |
diff --git a/net/core/dev.c b/net/core/dev.c index 8ae6631abcc2..6561021d22d1 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -1114,13 +1114,21 @@ EXPORT_SYMBOL(netdev_bonding_change); | |||
1114 | void dev_load(struct net *net, const char *name) | 1114 | void dev_load(struct net *net, const char *name) |
1115 | { | 1115 | { |
1116 | struct net_device *dev; | 1116 | struct net_device *dev; |
1117 | int no_module; | ||
1117 | 1118 | ||
1118 | rcu_read_lock(); | 1119 | rcu_read_lock(); |
1119 | dev = dev_get_by_name_rcu(net, name); | 1120 | dev = dev_get_by_name_rcu(net, name); |
1120 | rcu_read_unlock(); | 1121 | rcu_read_unlock(); |
1121 | 1122 | ||
1122 | if (!dev && capable(CAP_NET_ADMIN)) | 1123 | no_module = !dev; |
1123 | request_module("%s", name); | 1124 | if (no_module && capable(CAP_NET_ADMIN)) |
1125 | no_module = request_module("netdev-%s", name); | ||
1126 | if (no_module && capable(CAP_SYS_MODULE)) { | ||
1127 | if (!request_module("%s", name)) | ||
1128 | pr_err("Loading kernel module for a network device " | ||
1129 | "with CAP_SYS_MODULE (deprecated). Use CAP_NET_ADMIN and alias netdev-%s " | ||
1130 | "instead\n", name); | ||
1131 | } | ||
1124 | } | 1132 | } |
1125 | EXPORT_SYMBOL(dev_load); | 1133 | EXPORT_SYMBOL(dev_load); |
1126 | 1134 | ||
diff --git a/net/core/pktgen.c b/net/core/pktgen.c index a9e7fc4c461f..b5bada92f637 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c | |||
@@ -3321,7 +3321,7 @@ static void show_results(struct pktgen_dev *pkt_dev, int nr_frags) | |||
3321 | pkt_dev->started_at); | 3321 | pkt_dev->started_at); |
3322 | ktime_t idle = ns_to_ktime(pkt_dev->idle_acc); | 3322 | ktime_t idle = ns_to_ktime(pkt_dev->idle_acc); |
3323 | 3323 | ||
3324 | p += sprintf(p, "OK: %llu(c%llu+d%llu) nsec, %llu (%dbyte,%dfrags)\n", | 3324 | p += sprintf(p, "OK: %llu(c%llu+d%llu) usec, %llu (%dbyte,%dfrags)\n", |
3325 | (unsigned long long)ktime_to_us(elapsed), | 3325 | (unsigned long long)ktime_to_us(elapsed), |
3326 | (unsigned long long)ktime_to_us(ktime_sub(elapsed, idle)), | 3326 | (unsigned long long)ktime_to_us(ktime_sub(elapsed, idle)), |
3327 | (unsigned long long)ktime_to_us(idle), | 3327 | (unsigned long long)ktime_to_us(idle), |
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index df4616fce929..036652c8166d 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c | |||
@@ -670,7 +670,7 @@ int devinet_ioctl(struct net *net, unsigned int cmd, void __user *arg) | |||
670 | ifap = &ifa->ifa_next) { | 670 | ifap = &ifa->ifa_next) { |
671 | if (!strcmp(ifr.ifr_name, ifa->ifa_label) && | 671 | if (!strcmp(ifr.ifr_name, ifa->ifa_label) && |
672 | sin_orig.sin_addr.s_addr == | 672 | sin_orig.sin_addr.s_addr == |
673 | ifa->ifa_address) { | 673 | ifa->ifa_local) { |
674 | break; /* found */ | 674 | break; /* found */ |
675 | } | 675 | } |
676 | } | 676 | } |
@@ -1040,8 +1040,8 @@ static void inetdev_send_gratuitous_arp(struct net_device *dev, | |||
1040 | return; | 1040 | return; |
1041 | 1041 | ||
1042 | arp_send(ARPOP_REQUEST, ETH_P_ARP, | 1042 | arp_send(ARPOP_REQUEST, ETH_P_ARP, |
1043 | ifa->ifa_address, dev, | 1043 | ifa->ifa_local, dev, |
1044 | ifa->ifa_address, NULL, | 1044 | ifa->ifa_local, NULL, |
1045 | dev->dev_addr, NULL); | 1045 | dev->dev_addr, NULL); |
1046 | } | 1046 | } |
1047 | 1047 | ||
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index 6613edfac28c..d1d0e2c256fc 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c | |||
@@ -1765,4 +1765,4 @@ module_exit(ipgre_fini); | |||
1765 | MODULE_LICENSE("GPL"); | 1765 | MODULE_LICENSE("GPL"); |
1766 | MODULE_ALIAS_RTNL_LINK("gre"); | 1766 | MODULE_ALIAS_RTNL_LINK("gre"); |
1767 | MODULE_ALIAS_RTNL_LINK("gretap"); | 1767 | MODULE_ALIAS_RTNL_LINK("gretap"); |
1768 | MODULE_ALIAS("gre0"); | 1768 | MODULE_ALIAS_NETDEV("gre0"); |
diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c index 988f52fba54a..a5f58e7cbb26 100644 --- a/net/ipv4/ipip.c +++ b/net/ipv4/ipip.c | |||
@@ -913,4 +913,4 @@ static void __exit ipip_fini(void) | |||
913 | module_init(ipip_init); | 913 | module_init(ipip_init); |
914 | module_exit(ipip_fini); | 914 | module_exit(ipip_fini); |
915 | MODULE_LICENSE("GPL"); | 915 | MODULE_LICENSE("GPL"); |
916 | MODULE_ALIAS("tunl0"); | 916 | MODULE_ALIAS_NETDEV("tunl0"); |
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c index 4f4483e697bd..e528a42a52be 100644 --- a/net/ipv6/ip6_tunnel.c +++ b/net/ipv6/ip6_tunnel.c | |||
@@ -57,6 +57,7 @@ | |||
57 | MODULE_AUTHOR("Ville Nuorvala"); | 57 | MODULE_AUTHOR("Ville Nuorvala"); |
58 | MODULE_DESCRIPTION("IPv6 tunneling device"); | 58 | MODULE_DESCRIPTION("IPv6 tunneling device"); |
59 | MODULE_LICENSE("GPL"); | 59 | MODULE_LICENSE("GPL"); |
60 | MODULE_ALIAS_NETDEV("ip6tnl0"); | ||
60 | 61 | ||
61 | #ifdef IP6_TNL_DEBUG | 62 | #ifdef IP6_TNL_DEBUG |
62 | #define IP6_TNL_TRACE(x...) printk(KERN_DEBUG "%s:" x "\n", __func__) | 63 | #define IP6_TNL_TRACE(x...) printk(KERN_DEBUG "%s:" x "\n", __func__) |
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 904312e25a3c..e7db7014e89f 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
@@ -739,8 +739,10 @@ restart: | |||
739 | 739 | ||
740 | if (!rt->rt6i_nexthop && !(rt->rt6i_flags & RTF_NONEXTHOP)) | 740 | if (!rt->rt6i_nexthop && !(rt->rt6i_flags & RTF_NONEXTHOP)) |
741 | nrt = rt6_alloc_cow(rt, &fl->fl6_dst, &fl->fl6_src); | 741 | nrt = rt6_alloc_cow(rt, &fl->fl6_dst, &fl->fl6_src); |
742 | else | 742 | else if (!(rt->dst.flags & DST_HOST)) |
743 | nrt = rt6_alloc_clone(rt, &fl->fl6_dst); | 743 | nrt = rt6_alloc_clone(rt, &fl->fl6_dst); |
744 | else | ||
745 | goto out2; | ||
744 | 746 | ||
745 | dst_release(&rt->dst); | 747 | dst_release(&rt->dst); |
746 | rt = nrt ? : net->ipv6.ip6_null_entry; | 748 | rt = nrt ? : net->ipv6.ip6_null_entry; |
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c index 8ce38f10a547..d2c16e10f650 100644 --- a/net/ipv6/sit.c +++ b/net/ipv6/sit.c | |||
@@ -1290,4 +1290,4 @@ static int __init sit_init(void) | |||
1290 | module_init(sit_init); | 1290 | module_init(sit_init); |
1291 | module_exit(sit_cleanup); | 1291 | module_exit(sit_cleanup); |
1292 | MODULE_LICENSE("GPL"); | 1292 | MODULE_LICENSE("GPL"); |
1293 | MODULE_ALIAS("sit0"); | 1293 | MODULE_ALIAS_NETDEV("sit0"); |
diff --git a/net/rds/ib_send.c b/net/rds/ib_send.c index 71f373c421bc..c47a511f203d 100644 --- a/net/rds/ib_send.c +++ b/net/rds/ib_send.c | |||
@@ -551,7 +551,10 @@ int rds_ib_xmit(struct rds_connection *conn, struct rds_message *rm, | |||
551 | if (conn->c_loopback | 551 | if (conn->c_loopback |
552 | && rm->m_inc.i_hdr.h_flags & RDS_FLAG_CONG_BITMAP) { | 552 | && rm->m_inc.i_hdr.h_flags & RDS_FLAG_CONG_BITMAP) { |
553 | rds_cong_map_updated(conn->c_fcong, ~(u64) 0); | 553 | rds_cong_map_updated(conn->c_fcong, ~(u64) 0); |
554 | return sizeof(struct rds_header) + RDS_CONG_MAP_BYTES; | 554 | scat = &rm->data.op_sg[sg]; |
555 | ret = sizeof(struct rds_header) + RDS_CONG_MAP_BYTES; | ||
556 | ret = min_t(int, ret, scat->length - conn->c_xmit_data_off); | ||
557 | return ret; | ||
555 | } | 558 | } |
556 | 559 | ||
557 | /* FIXME we may overallocate here */ | 560 | /* FIXME we may overallocate here */ |
diff --git a/net/rds/loop.c b/net/rds/loop.c index aeec1d483b17..bca6761a3ca2 100644 --- a/net/rds/loop.c +++ b/net/rds/loop.c | |||
@@ -61,10 +61,15 @@ static int rds_loop_xmit(struct rds_connection *conn, struct rds_message *rm, | |||
61 | unsigned int hdr_off, unsigned int sg, | 61 | unsigned int hdr_off, unsigned int sg, |
62 | unsigned int off) | 62 | unsigned int off) |
63 | { | 63 | { |
64 | struct scatterlist *sgp = &rm->data.op_sg[sg]; | ||
65 | int ret = sizeof(struct rds_header) + | ||
66 | be32_to_cpu(rm->m_inc.i_hdr.h_len); | ||
67 | |||
64 | /* Do not send cong updates to loopback */ | 68 | /* Do not send cong updates to loopback */ |
65 | if (rm->m_inc.i_hdr.h_flags & RDS_FLAG_CONG_BITMAP) { | 69 | if (rm->m_inc.i_hdr.h_flags & RDS_FLAG_CONG_BITMAP) { |
66 | rds_cong_map_updated(conn->c_fcong, ~(u64) 0); | 70 | rds_cong_map_updated(conn->c_fcong, ~(u64) 0); |
67 | return sizeof(struct rds_header) + RDS_CONG_MAP_BYTES; | 71 | ret = min_t(int, ret, sgp->length - conn->c_xmit_data_off); |
72 | goto out; | ||
68 | } | 73 | } |
69 | 74 | ||
70 | BUG_ON(hdr_off || sg || off); | 75 | BUG_ON(hdr_off || sg || off); |
@@ -80,8 +85,8 @@ static int rds_loop_xmit(struct rds_connection *conn, struct rds_message *rm, | |||
80 | NULL); | 85 | NULL); |
81 | 86 | ||
82 | rds_inc_put(&rm->m_inc); | 87 | rds_inc_put(&rm->m_inc); |
83 | 88 | out: | |
84 | return sizeof(struct rds_header) + be32_to_cpu(rm->m_inc.i_hdr.h_len); | 89 | return ret; |
85 | } | 90 | } |
86 | 91 | ||
87 | /* | 92 | /* |
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index dd419d286204..437a99e560e1 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c | |||
@@ -1724,7 +1724,11 @@ static int unix_dgram_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
1724 | 1724 | ||
1725 | msg->msg_namelen = 0; | 1725 | msg->msg_namelen = 0; |
1726 | 1726 | ||
1727 | mutex_lock(&u->readlock); | 1727 | err = mutex_lock_interruptible(&u->readlock); |
1728 | if (err) { | ||
1729 | err = sock_intr_errno(sock_rcvtimeo(sk, noblock)); | ||
1730 | goto out; | ||
1731 | } | ||
1728 | 1732 | ||
1729 | skb = skb_recv_datagram(sk, flags, noblock, &err); | 1733 | skb = skb_recv_datagram(sk, flags, noblock, &err); |
1730 | if (!skb) { | 1734 | if (!skb) { |
@@ -1864,7 +1868,11 @@ static int unix_stream_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
1864 | memset(&tmp_scm, 0, sizeof(tmp_scm)); | 1868 | memset(&tmp_scm, 0, sizeof(tmp_scm)); |
1865 | } | 1869 | } |
1866 | 1870 | ||
1867 | mutex_lock(&u->readlock); | 1871 | err = mutex_lock_interruptible(&u->readlock); |
1872 | if (err) { | ||
1873 | err = sock_intr_errno(timeo); | ||
1874 | goto out; | ||
1875 | } | ||
1868 | 1876 | ||
1869 | do { | 1877 | do { |
1870 | int chunk; | 1878 | int chunk; |
@@ -1895,11 +1903,12 @@ static int unix_stream_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
1895 | 1903 | ||
1896 | timeo = unix_stream_data_wait(sk, timeo); | 1904 | timeo = unix_stream_data_wait(sk, timeo); |
1897 | 1905 | ||
1898 | if (signal_pending(current)) { | 1906 | if (signal_pending(current) |
1907 | || mutex_lock_interruptible(&u->readlock)) { | ||
1899 | err = sock_intr_errno(timeo); | 1908 | err = sock_intr_errno(timeo); |
1900 | goto out; | 1909 | goto out; |
1901 | } | 1910 | } |
1902 | mutex_lock(&u->readlock); | 1911 | |
1903 | continue; | 1912 | continue; |
1904 | unlock: | 1913 | unlock: |
1905 | unix_state_unlock(sk); | 1914 | unix_state_unlock(sk); |