aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/networking/vortex.txt2
-rw-r--r--MAINTAINERS48
-rw-r--r--drivers/net/r8169.c2
-rw-r--r--include/linux/if_tr.h2
-rw-r--r--include/linux/sysctl.h1
-rw-r--r--include/net/ip.h1
-rw-r--r--net/ipv4/af_inet.c1
-rw-r--r--net/ipv4/icmp.c9
-rw-r--r--net/ipv4/multipath_drr.c2
-rw-r--r--net/ipv4/multipath_random.c2
-rw-r--r--net/ipv4/multipath_rr.c2
-rw-r--r--net/ipv4/multipath_wrandom.c2
-rw-r--r--net/ipv4/sysctl_net_ipv4.c9
-rw-r--r--net/ipv4/tcp.c2
-rw-r--r--net/ipv6/addrconf.c1
-rw-r--r--net/ipv6/icmp.c14
-rw-r--r--net/sched/act_api.c2
-rw-r--r--net/sctp/input.c49
-rw-r--r--net/sctp/ipv6.c36
-rw-r--r--net/sctp/proc.c194
-rw-r--r--net/sctp/protocol.c7
-rw-r--r--net/sctp/socket.c12
22 files changed, 285 insertions, 115 deletions
diff --git a/Documentation/networking/vortex.txt b/Documentation/networking/vortex.txt
index fa12a9e4abdd..80e1cb19609f 100644
--- a/Documentation/networking/vortex.txt
+++ b/Documentation/networking/vortex.txt
@@ -12,7 +12,7 @@ Don is no longer the prime maintainer of this version of the driver.
12Please report problems to one or more of: 12Please report problems to one or more of:
13 13
14 Andrew Morton <andrewm@uow.edu.au> 14 Andrew Morton <andrewm@uow.edu.au>
15 Netdev mailing list <netdev@oss.sgi.com> 15 Netdev mailing list <netdev@vger.kernel.org>
16 Linux kernel mailing list <linux-kernel@vger.kernel.org> 16 Linux kernel mailing list <linux-kernel@vger.kernel.org>
17 17
18Please note the 'Reporting and Diagnosing Problems' section at the end 18Please note the 'Reporting and Diagnosing Problems' section at the end
diff --git a/MAINTAINERS b/MAINTAINERS
index 65ad8251e4bc..86ba94f16e83 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -73,7 +73,7 @@ S: Status, one of the following:
733C359 NETWORK DRIVER 733C359 NETWORK DRIVER
74P: Mike Phillips 74P: Mike Phillips
75M: mikep@linuxtr.net 75M: mikep@linuxtr.net
76L: netdev@oss.sgi.com 76L: netdev@vger.kernel.org
77L: linux-tr@linuxtr.net 77L: linux-tr@linuxtr.net
78W: http://www.linuxtr.net 78W: http://www.linuxtr.net
79S: Maintained 79S: Maintained
@@ -81,13 +81,13 @@ S: Maintained
813C505 NETWORK DRIVER 813C505 NETWORK DRIVER
82P: Philip Blundell 82P: Philip Blundell
83M: philb@gnu.org 83M: philb@gnu.org
84L: netdev@oss.sgi.com 84L: netdev@vger.kernel.org
85S: Maintained 85S: Maintained
86 86
873CR990 NETWORK DRIVER 873CR990 NETWORK DRIVER
88P: David Dillow 88P: David Dillow
89M: dave@thedillows.org 89M: dave@thedillows.org
90L: netdev@oss.sgi.com 90L: netdev@vger.kernel.org
91S: Maintained 91S: Maintained
92 92
933W-XXXX ATA-RAID CONTROLLER DRIVER 933W-XXXX ATA-RAID CONTROLLER DRIVER
@@ -130,7 +130,7 @@ S: Maintained
1308169 10/100/1000 GIGABIT ETHERNET DRIVER 1308169 10/100/1000 GIGABIT ETHERNET DRIVER
131P: Francois Romieu 131P: Francois Romieu
132M: romieu@fr.zoreil.com 132M: romieu@fr.zoreil.com
133L: netdev@oss.sgi.com 133L: netdev@vger.kernel.org
134S: Maintained 134S: Maintained
135 135
1368250/16?50 (AND CLONE UARTS) SERIAL DRIVER 1368250/16?50 (AND CLONE UARTS) SERIAL DRIVER
@@ -143,7 +143,7 @@ S: Maintained
1438390 NETWORK DRIVERS [WD80x3/SMC-ELITE, SMC-ULTRA, NE2000, 3C503, etc.] 1438390 NETWORK DRIVERS [WD80x3/SMC-ELITE, SMC-ULTRA, NE2000, 3C503, etc.]
144P: Paul Gortmaker 144P: Paul Gortmaker
145M: p_gortmaker@yahoo.com 145M: p_gortmaker@yahoo.com
146L: netdev@oss.sgi.com 146L: netdev@vger.kernel.org
147S: Maintained 147S: Maintained
148 148
149A2232 SERIAL BOARD DRIVER 149A2232 SERIAL BOARD DRIVER
@@ -332,7 +332,7 @@ S: Maintained
332 332
333ARPD SUPPORT 333ARPD SUPPORT
334P: Jonathan Layes 334P: Jonathan Layes
335L: netdev@oss.sgi.com 335L: netdev@vger.kernel.org
336S: Maintained 336S: Maintained
337 337
338ASUS ACPI EXTRAS DRIVER 338ASUS ACPI EXTRAS DRIVER
@@ -706,7 +706,7 @@ S: Orphaned
706 706
707DIGI RIGHTSWITCH NETWORK DRIVER 707DIGI RIGHTSWITCH NETWORK DRIVER
708P: Rick Richardson 708P: Rick Richardson
709L: netdev@oss.sgi.com 709L: netdev@vger.kernel.org
710W: http://www.digi.com 710W: http://www.digi.com
711S: Orphaned 711S: Orphaned
712 712
@@ -812,7 +812,7 @@ S: Maintained
812ETHEREXPRESS-16 NETWORK DRIVER 812ETHEREXPRESS-16 NETWORK DRIVER
813P: Philip Blundell 813P: Philip Blundell
814M: philb@gnu.org 814M: philb@gnu.org
815L: netdev@oss.sgi.com 815L: netdev@vger.kernel.org
816S: Maintained 816S: Maintained
817 817
818ETHERNET BRIDGE 818ETHERNET BRIDGE
@@ -875,7 +875,7 @@ S: Maintained
875FRAME RELAY DLCI/FRAD (Sangoma drivers too) 875FRAME RELAY DLCI/FRAD (Sangoma drivers too)
876P: Mike McLagan 876P: Mike McLagan
877M: mike.mclagan@linux.org 877M: mike.mclagan@linux.org
878L: netdev@oss.sgi.com 878L: netdev@vger.kernel.org
879S: Maintained 879S: Maintained
880 880
881FREEVXFS FILESYSTEM 881FREEVXFS FILESYSTEM
@@ -1215,7 +1215,7 @@ S: Maintained
1215IPX NETWORK LAYER 1215IPX NETWORK LAYER
1216P: Arnaldo Carvalho de Melo 1216P: Arnaldo Carvalho de Melo
1217M: acme@conectiva.com.br 1217M: acme@conectiva.com.br
1218L: netdev@oss.sgi.com 1218L: netdev@vger.kernel.org
1219S: Maintained 1219S: Maintained
1220 1220
1221IRDA SUBSYSTEM 1221IRDA SUBSYSTEM
@@ -1482,7 +1482,7 @@ MARVELL MV64340 ETHERNET DRIVER
1482P: Manish Lachwani 1482P: Manish Lachwani
1483M: Manish_Lachwani@pmc-sierra.com 1483M: Manish_Lachwani@pmc-sierra.com
1484L: linux-mips@linux-mips.org 1484L: linux-mips@linux-mips.org
1485L: netdev@oss.sgi.com 1485L: netdev@vger.kernel.org
1486S: Supported 1486S: Supported
1487 1487
1488MATROX FRAMEBUFFER DRIVER 1488MATROX FRAMEBUFFER DRIVER
@@ -1592,13 +1592,13 @@ P: Andrew Morton
1592M: akpm@osdl.org 1592M: akpm@osdl.org
1593P: Jeff Garzik 1593P: Jeff Garzik
1594M: jgarzik@pobox.com 1594M: jgarzik@pobox.com
1595L: netdev@oss.sgi.com 1595L: netdev@vger.kernel.org
1596S: Maintained 1596S: Maintained
1597 1597
1598NETWORKING [GENERAL] 1598NETWORKING [GENERAL]
1599P: Networking Team 1599P: Networking Team
1600M: netdev@oss.sgi.com 1600M: netdev@vger.kernel.org
1601L: netdev@oss.sgi.com 1601L: netdev@vger.kernel.org
1602S: Maintained 1602S: Maintained
1603 1603
1604NETWORKING [IPv4/IPv6] 1604NETWORKING [IPv4/IPv6]
@@ -1614,7 +1614,7 @@ P: Hideaki YOSHIFUJI
1614M: yoshfuji@linux-ipv6.org 1614M: yoshfuji@linux-ipv6.org
1615P: Patrick McHardy 1615P: Patrick McHardy
1616M: kaber@coreworks.de 1616M: kaber@coreworks.de
1617L: netdev@oss.sgi.com 1617L: netdev@vger.kernel.org
1618S: Maintained 1618S: Maintained
1619 1619
1620IPVS 1620IPVS
@@ -1634,7 +1634,7 @@ NI5010 NETWORK DRIVER
1634P: Jan-Pascal van Best and Andreas Mohr 1634P: Jan-Pascal van Best and Andreas Mohr
1635M: Jan-Pascal van Best <jvbest@qv3pluto.leidenuniv.nl> 1635M: Jan-Pascal van Best <jvbest@qv3pluto.leidenuniv.nl>
1636M: Andreas Mohr <100.30936@germany.net> 1636M: Andreas Mohr <100.30936@germany.net>
1637L: netdev@oss.sgi.com 1637L: netdev@vger.kernel.org
1638S: Maintained 1638S: Maintained
1639 1639
1640NINJA SCSI-3 / NINJA SCSI-32Bi (16bit/CardBus) PCMCIA SCSI HOST ADAPTER DRIVER 1640NINJA SCSI-3 / NINJA SCSI-32Bi (16bit/CardBus) PCMCIA SCSI HOST ADAPTER DRIVER
@@ -1676,7 +1676,7 @@ P: Peter De Shrijver
1676M: p2@ace.ulyssis.student.kuleuven.ac.be 1676M: p2@ace.ulyssis.student.kuleuven.ac.be
1677P: Mike Phillips 1677P: Mike Phillips
1678M: mikep@linuxtr.net 1678M: mikep@linuxtr.net
1679L: netdev@oss.sgi.com 1679L: netdev@vger.kernel.org
1680L: linux-tr@linuxtr.net 1680L: linux-tr@linuxtr.net
1681W: http://www.linuxtr.net 1681W: http://www.linuxtr.net
1682S: Maintained 1682S: Maintained
@@ -1783,7 +1783,7 @@ S: Unmaintained
1783PCNET32 NETWORK DRIVER 1783PCNET32 NETWORK DRIVER
1784P: Thomas Bogendörfer 1784P: Thomas Bogendörfer
1785M: tsbogend@alpha.franken.de 1785M: tsbogend@alpha.franken.de
1786L: netdev@oss.sgi.com 1786L: netdev@vger.kernel.org
1787S: Maintained 1787S: Maintained
1788 1788
1789PHRAM MTD DRIVER 1789PHRAM MTD DRIVER
@@ -1795,7 +1795,7 @@ S: Maintained
1795POSIX CLOCKS and TIMERS 1795POSIX CLOCKS and TIMERS
1796P: George Anzinger 1796P: George Anzinger
1797M: george@mvista.com 1797M: george@mvista.com
1798L: netdev@oss.sgi.com 1798L: netdev@vger.kernel.org
1799S: Supported 1799S: Supported
1800 1800
1801PNP SUPPORT 1801PNP SUPPORT
@@ -1830,7 +1830,7 @@ S: Supported
1830PRISM54 WIRELESS DRIVER 1830PRISM54 WIRELESS DRIVER
1831P: Prism54 Development Team 1831P: Prism54 Development Team
1832M: prism54-private@prism54.org 1832M: prism54-private@prism54.org
1833L: netdev@oss.sgi.com 1833L: netdev@vger.kernel.org
1834W: http://prism54.org 1834W: http://prism54.org
1835S: Maintained 1835S: Maintained
1836 1836
@@ -2047,7 +2047,7 @@ SIS 900/7016 FAST ETHERNET DRIVER
2047P: Daniele Venzano 2047P: Daniele Venzano
2048M: venza@brownhat.org 2048M: venza@brownhat.org
2049W: http://www.brownhat.org/sis900.html 2049W: http://www.brownhat.org/sis900.html
2050L: netdev@oss.sgi.com 2050L: netdev@vger.kernel.org
2051S: Maintained 2051S: Maintained
2052 2052
2053SIS FRAMEBUFFER DRIVER 2053SIS FRAMEBUFFER DRIVER
@@ -2106,7 +2106,7 @@ S: Maintained
2106SONIC NETWORK DRIVER 2106SONIC NETWORK DRIVER
2107P: Thomas Bogendoerfer 2107P: Thomas Bogendoerfer
2108M: tsbogend@alpha.franken.de 2108M: tsbogend@alpha.franken.de
2109L: netdev@oss.sgi.com 2109L: netdev@vger.kernel.org
2110S: Maintained 2110S: Maintained
2111 2111
2112SONY VAIO CONTROL DEVICE DRIVER 2112SONY VAIO CONTROL DEVICE DRIVER
@@ -2163,7 +2163,7 @@ S: Supported
2163SPX NETWORK LAYER 2163SPX NETWORK LAYER
2164P: Jay Schulist 2164P: Jay Schulist
2165M: jschlst@samba.org 2165M: jschlst@samba.org
2166L: netdev@oss.sgi.com 2166L: netdev@vger.kernel.org
2167S: Supported 2167S: Supported
2168 2168
2169SRM (Alpha) environment access 2169SRM (Alpha) environment access
@@ -2242,7 +2242,7 @@ S: Maintained
2242TOKEN-RING NETWORK DRIVER 2242TOKEN-RING NETWORK DRIVER
2243P: Mike Phillips 2243P: Mike Phillips
2244M: mikep@linuxtr.net 2244M: mikep@linuxtr.net
2245L: netdev@oss.sgi.com 2245L: netdev@vger.kernel.org
2246L: linux-tr@linuxtr.net 2246L: linux-tr@linuxtr.net
2247W: http://www.linuxtr.net 2247W: http://www.linuxtr.net
2248S: Maintained 2248S: Maintained
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index b3768d844747..d6d0e43dab65 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -415,7 +415,7 @@ struct rtl8169_private {
415 struct work_struct task; 415 struct work_struct task;
416}; 416};
417 417
418MODULE_AUTHOR("Realtek and the Linux r8169 crew <netdev@oss.sgi.com>"); 418MODULE_AUTHOR("Realtek and the Linux r8169 crew <netdev@vger.kernel.org>");
419MODULE_DESCRIPTION("RealTek RTL-8169 Gigabit Ethernet driver"); 419MODULE_DESCRIPTION("RealTek RTL-8169 Gigabit Ethernet driver");
420module_param_array(media, int, &num_media, 0); 420module_param_array(media, int, &num_media, 0);
421module_param(rx_copybreak, int, 0); 421module_param(rx_copybreak, int, 0);
diff --git a/include/linux/if_tr.h b/include/linux/if_tr.h
index 6688b414c529..3fba9e2f5427 100644
--- a/include/linux/if_tr.h
+++ b/include/linux/if_tr.h
@@ -19,6 +19,8 @@
19#ifndef _LINUX_IF_TR_H 19#ifndef _LINUX_IF_TR_H
20#define _LINUX_IF_TR_H 20#define _LINUX_IF_TR_H
21 21
22#include <asm/byteorder.h> /* For __be16 */
23
22/* IEEE 802.5 Token-Ring magic constants. The frame sizes omit the preamble 24/* IEEE 802.5 Token-Ring magic constants. The frame sizes omit the preamble
23 and FCS/CRC (frame check sequence). */ 25 and FCS/CRC (frame check sequence). */
24#define TR_ALEN 6 /* Octets in one token-ring addr */ 26#define TR_ALEN 6 /* Octets in one token-ring addr */
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index 23032d9d6071..a17745c80a91 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -346,6 +346,7 @@ enum
346 NET_TCP_MODERATE_RCVBUF=106, 346 NET_TCP_MODERATE_RCVBUF=106,
347 NET_TCP_TSO_WIN_DIVISOR=107, 347 NET_TCP_TSO_WIN_DIVISOR=107,
348 NET_TCP_BIC_BETA=108, 348 NET_TCP_BIC_BETA=108,
349 NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR=109,
349}; 350};
350 351
351enum { 352enum {
diff --git a/include/net/ip.h b/include/net/ip.h
index 3f63992eb712..32360bbe143f 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -163,6 +163,7 @@ DECLARE_SNMP_STAT(struct linux_mib, net_statistics);
163 163
164extern int sysctl_local_port_range[2]; 164extern int sysctl_local_port_range[2];
165extern int sysctl_ip_default_ttl; 165extern int sysctl_ip_default_ttl;
166extern int sysctl_ip_nonlocal_bind;
166 167
167#ifdef CONFIG_INET 168#ifdef CONFIG_INET
168/* The function in 2.2 was invalid, producing wrong result for 169/* The function in 2.2 was invalid, producing wrong result for
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index b3cb49ce5fad..03942f133944 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -1181,6 +1181,7 @@ EXPORT_SYMBOL(inet_stream_connect);
1181EXPORT_SYMBOL(inet_stream_ops); 1181EXPORT_SYMBOL(inet_stream_ops);
1182EXPORT_SYMBOL(inet_unregister_protosw); 1182EXPORT_SYMBOL(inet_unregister_protosw);
1183EXPORT_SYMBOL(net_statistics); 1183EXPORT_SYMBOL(net_statistics);
1184EXPORT_SYMBOL(sysctl_ip_nonlocal_bind);
1184 1185
1185#ifdef INET_REFCNT_DEBUG 1186#ifdef INET_REFCNT_DEBUG
1186EXPORT_SYMBOL(inet_sock_nr); 1187EXPORT_SYMBOL(inet_sock_nr);
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
index 85bf0d3e294b..cb759484979d 100644
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -207,6 +207,7 @@ int sysctl_icmp_ignore_bogus_error_responses;
207 207
208int sysctl_icmp_ratelimit = 1 * HZ; 208int sysctl_icmp_ratelimit = 1 * HZ;
209int sysctl_icmp_ratemask = 0x1818; 209int sysctl_icmp_ratemask = 0x1818;
210int sysctl_icmp_errors_use_inbound_ifaddr;
210 211
211/* 212/*
212 * ICMP control array. This specifies what to do with each ICMP. 213 * ICMP control array. This specifies what to do with each ICMP.
@@ -511,8 +512,12 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, u32 info)
511 */ 512 */
512 513
513 saddr = iph->daddr; 514 saddr = iph->daddr;
514 if (!(rt->rt_flags & RTCF_LOCAL)) 515 if (!(rt->rt_flags & RTCF_LOCAL)) {
515 saddr = 0; 516 if (sysctl_icmp_errors_use_inbound_ifaddr)
517 saddr = inet_select_addr(skb_in->dev, 0, RT_SCOPE_LINK);
518 else
519 saddr = 0;
520 }
516 521
517 tos = icmp_pointers[type].error ? ((iph->tos & IPTOS_TOS_MASK) | 522 tos = icmp_pointers[type].error ? ((iph->tos & IPTOS_TOS_MASK) |
518 IPTOS_PREC_INTERNETCONTROL) : 523 IPTOS_PREC_INTERNETCONTROL) :
diff --git a/net/ipv4/multipath_drr.c b/net/ipv4/multipath_drr.c
index cf2e6bcf7973..c9cf8726051d 100644
--- a/net/ipv4/multipath_drr.c
+++ b/net/ipv4/multipath_drr.c
@@ -31,6 +31,7 @@
31#include <linux/igmp.h> 31#include <linux/igmp.h>
32#include <linux/proc_fs.h> 32#include <linux/proc_fs.h>
33#include <linux/seq_file.h> 33#include <linux/seq_file.h>
34#include <linux/module.h>
34#include <linux/mroute.h> 35#include <linux/mroute.h>
35#include <linux/init.h> 36#include <linux/init.h>
36#include <net/ip.h> 37#include <net/ip.h>
@@ -247,3 +248,4 @@ static void __exit drr_exit(void)
247 248
248module_init(drr_init); 249module_init(drr_init);
249module_exit(drr_exit); 250module_exit(drr_exit);
251MODULE_LICENSE("GPL");
diff --git a/net/ipv4/multipath_random.c b/net/ipv4/multipath_random.c
index 805a16e47de5..5249dbe7c559 100644
--- a/net/ipv4/multipath_random.c
+++ b/net/ipv4/multipath_random.c
@@ -31,6 +31,7 @@
31#include <linux/igmp.h> 31#include <linux/igmp.h>
32#include <linux/proc_fs.h> 32#include <linux/proc_fs.h>
33#include <linux/seq_file.h> 33#include <linux/seq_file.h>
34#include <linux/module.h>
34#include <linux/mroute.h> 35#include <linux/mroute.h>
35#include <linux/init.h> 36#include <linux/init.h>
36#include <net/ip.h> 37#include <net/ip.h>
@@ -126,3 +127,4 @@ static void __exit random_exit(void)
126 127
127module_init(random_init); 128module_init(random_init);
128module_exit(random_exit); 129module_exit(random_exit);
130MODULE_LICENSE("GPL");
diff --git a/net/ipv4/multipath_rr.c b/net/ipv4/multipath_rr.c
index 061b6b253982..b6cd2870478f 100644
--- a/net/ipv4/multipath_rr.c
+++ b/net/ipv4/multipath_rr.c
@@ -31,6 +31,7 @@
31#include <linux/igmp.h> 31#include <linux/igmp.h>
32#include <linux/proc_fs.h> 32#include <linux/proc_fs.h>
33#include <linux/seq_file.h> 33#include <linux/seq_file.h>
34#include <linux/module.h>
34#include <linux/mroute.h> 35#include <linux/mroute.h>
35#include <linux/init.h> 36#include <linux/init.h>
36#include <net/ip.h> 37#include <net/ip.h>
@@ -93,3 +94,4 @@ static void __exit rr_exit(void)
93 94
94module_init(rr_init); 95module_init(rr_init);
95module_exit(rr_exit); 96module_exit(rr_exit);
97MODULE_LICENSE("GPL");
diff --git a/net/ipv4/multipath_wrandom.c b/net/ipv4/multipath_wrandom.c
index c3d2ca1a6781..bd7d75b6abe0 100644
--- a/net/ipv4/multipath_wrandom.c
+++ b/net/ipv4/multipath_wrandom.c
@@ -31,6 +31,7 @@
31#include <linux/igmp.h> 31#include <linux/igmp.h>
32#include <linux/proc_fs.h> 32#include <linux/proc_fs.h>
33#include <linux/seq_file.h> 33#include <linux/seq_file.h>
34#include <linux/module.h>
34#include <linux/mroute.h> 35#include <linux/mroute.h>
35#include <linux/init.h> 36#include <linux/init.h>
36#include <net/ip.h> 37#include <net/ip.h>
@@ -342,3 +343,4 @@ static void __exit wrandom_exit(void)
342 343
343module_init(wrandom_init); 344module_init(wrandom_init);
344module_exit(wrandom_exit); 345module_exit(wrandom_exit);
346MODULE_LICENSE("GPL");
diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c
index 3aafb298c1c1..23068bddbf0b 100644
--- a/net/ipv4/sysctl_net_ipv4.c
+++ b/net/ipv4/sysctl_net_ipv4.c
@@ -23,6 +23,7 @@ extern int sysctl_ip_nonlocal_bind;
23extern int sysctl_icmp_echo_ignore_all; 23extern int sysctl_icmp_echo_ignore_all;
24extern int sysctl_icmp_echo_ignore_broadcasts; 24extern int sysctl_icmp_echo_ignore_broadcasts;
25extern int sysctl_icmp_ignore_bogus_error_responses; 25extern int sysctl_icmp_ignore_bogus_error_responses;
26extern int sysctl_icmp_errors_use_inbound_ifaddr;
26 27
27/* From ip_fragment.c */ 28/* From ip_fragment.c */
28extern int sysctl_ipfrag_low_thresh; 29extern int sysctl_ipfrag_low_thresh;
@@ -396,6 +397,14 @@ ctl_table ipv4_table[] = {
396 .proc_handler = &proc_dointvec 397 .proc_handler = &proc_dointvec
397 }, 398 },
398 { 399 {
400 .ctl_name = NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR,
401 .procname = "icmp_errors_use_inbound_ifaddr",
402 .data = &sysctl_icmp_errors_use_inbound_ifaddr,
403 .maxlen = sizeof(int),
404 .mode = 0644,
405 .proc_handler = &proc_dointvec
406 },
407 {
399 .ctl_name = NET_IPV4_ROUTE, 408 .ctl_name = NET_IPV4_ROUTE,
400 .procname = "route", 409 .procname = "route",
401 .maxlen = 0, 410 .maxlen = 0,
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index a037bafcba3c..0d9a4fd5f1a4 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -2338,7 +2338,7 @@ void __init tcp_init(void)
2338 (tcp_bhash_size * sizeof(struct tcp_bind_hashbucket)); 2338 (tcp_bhash_size * sizeof(struct tcp_bind_hashbucket));
2339 order++) 2339 order++)
2340 ; 2340 ;
2341 if (order > 4) { 2341 if (order >= 4) {
2342 sysctl_local_port_range[0] = 32768; 2342 sysctl_local_port_range[0] = 32768;
2343 sysctl_local_port_range[1] = 61000; 2343 sysctl_local_port_range[1] = 61000;
2344 sysctl_tcp_max_tw_buckets = 180000; 2344 sysctl_tcp_max_tw_buckets = 180000;
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 7744a2592693..2720899d516c 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -372,6 +372,7 @@ static struct inet6_dev * ipv6_add_dev(struct net_device *dev)
372 ndev->regen_timer.data = (unsigned long) ndev; 372 ndev->regen_timer.data = (unsigned long) ndev;
373 if ((dev->flags&IFF_LOOPBACK) || 373 if ((dev->flags&IFF_LOOPBACK) ||
374 dev->type == ARPHRD_TUNNEL || 374 dev->type == ARPHRD_TUNNEL ||
375 dev->type == ARPHRD_NONE ||
375 dev->type == ARPHRD_SIT) { 376 dev->type == ARPHRD_SIT) {
376 printk(KERN_INFO 377 printk(KERN_INFO
377 "Disabled Privacy Extensions on device %p(%s)\n", 378 "Disabled Privacy Extensions on device %p(%s)\n",
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c
index 8e0f569b883e..ff3ec9822e36 100644
--- a/net/ipv6/icmp.c
+++ b/net/ipv6/icmp.c
@@ -277,8 +277,8 @@ void icmpv6_send(struct sk_buff *skb, int type, int code, __u32 info,
277{ 277{
278 struct inet6_dev *idev = NULL; 278 struct inet6_dev *idev = NULL;
279 struct ipv6hdr *hdr = skb->nh.ipv6h; 279 struct ipv6hdr *hdr = skb->nh.ipv6h;
280 struct sock *sk = icmpv6_socket->sk; 280 struct sock *sk;
281 struct ipv6_pinfo *np = inet6_sk(sk); 281 struct ipv6_pinfo *np;
282 struct in6_addr *saddr = NULL; 282 struct in6_addr *saddr = NULL;
283 struct dst_entry *dst; 283 struct dst_entry *dst;
284 struct icmp6hdr tmp_hdr; 284 struct icmp6hdr tmp_hdr;
@@ -358,6 +358,9 @@ void icmpv6_send(struct sk_buff *skb, int type, int code, __u32 info,
358 if (icmpv6_xmit_lock()) 358 if (icmpv6_xmit_lock())
359 return; 359 return;
360 360
361 sk = icmpv6_socket->sk;
362 np = inet6_sk(sk);
363
361 if (!icmpv6_xrlim_allow(sk, type, &fl)) 364 if (!icmpv6_xrlim_allow(sk, type, &fl))
362 goto out; 365 goto out;
363 366
@@ -423,9 +426,9 @@ out:
423 426
424static void icmpv6_echo_reply(struct sk_buff *skb) 427static void icmpv6_echo_reply(struct sk_buff *skb)
425{ 428{
426 struct sock *sk = icmpv6_socket->sk; 429 struct sock *sk;
427 struct inet6_dev *idev; 430 struct inet6_dev *idev;
428 struct ipv6_pinfo *np = inet6_sk(sk); 431 struct ipv6_pinfo *np;
429 struct in6_addr *saddr = NULL; 432 struct in6_addr *saddr = NULL;
430 struct icmp6hdr *icmph = (struct icmp6hdr *) skb->h.raw; 433 struct icmp6hdr *icmph = (struct icmp6hdr *) skb->h.raw;
431 struct icmp6hdr tmp_hdr; 434 struct icmp6hdr tmp_hdr;
@@ -454,6 +457,9 @@ static void icmpv6_echo_reply(struct sk_buff *skb)
454 if (icmpv6_xmit_lock()) 457 if (icmpv6_xmit_lock())
455 return; 458 return;
456 459
460 sk = icmpv6_socket->sk;
461 np = inet6_sk(sk);
462
457 if (!fl.oif && ipv6_addr_is_multicast(&fl.fl6_dst)) 463 if (!fl.oif && ipv6_addr_is_multicast(&fl.fl6_dst))
458 fl.oif = np->mcast_oif; 464 fl.oif = np->mcast_oif;
459 465
diff --git a/net/sched/act_api.c b/net/sched/act_api.c
index cafcb084098d..914c85ff8fe6 100644
--- a/net/sched/act_api.c
+++ b/net/sched/act_api.c
@@ -881,7 +881,7 @@ static int __init tc_action_init(void)
881 link_p[RTM_GETACTION-RTM_BASE].dumpit = tc_dump_action; 881 link_p[RTM_GETACTION-RTM_BASE].dumpit = tc_dump_action;
882 } 882 }
883 883
884 printk("TC classifier action (bugs to netdev@oss.sgi.com cc " 884 printk("TC classifier action (bugs to netdev@vger.kernel.org cc "
885 "hadi@cyberus.ca)\n"); 885 "hadi@cyberus.ca)\n");
886 return 0; 886 return 0;
887} 887}
diff --git a/net/sctp/input.c b/net/sctp/input.c
index b719a77d66b4..fffc880a646d 100644
--- a/net/sctp/input.c
+++ b/net/sctp/input.c
@@ -178,6 +178,37 @@ int sctp_rcv(struct sk_buff *skb)
178 178
179 asoc = __sctp_rcv_lookup(skb, &src, &dest, &transport); 179 asoc = __sctp_rcv_lookup(skb, &src, &dest, &transport);
180 180
181 if (!asoc)
182 ep = __sctp_rcv_lookup_endpoint(&dest);
183
184 /* Retrieve the common input handling substructure. */
185 rcvr = asoc ? &asoc->base : &ep->base;
186 sk = rcvr->sk;
187
188 /*
189 * If a frame arrives on an interface and the receiving socket is
190 * bound to another interface, via SO_BINDTODEVICE, treat it as OOTB
191 */
192 if (sk->sk_bound_dev_if && (sk->sk_bound_dev_if != af->skb_iif(skb)))
193 {
194 sock_put(sk);
195 if (asoc) {
196 sctp_association_put(asoc);
197 asoc = NULL;
198 } else {
199 sctp_endpoint_put(ep);
200 ep = NULL;
201 }
202 sk = sctp_get_ctl_sock();
203 ep = sctp_sk(sk)->ep;
204 sctp_endpoint_hold(ep);
205 sock_hold(sk);
206 rcvr = &ep->base;
207 }
208
209 if (atomic_read(&sk->sk_rmem_alloc) >= sk->sk_rcvbuf)
210 goto discard_release;
211
181 /* 212 /*
182 * RFC 2960, 8.4 - Handle "Out of the blue" Packets. 213 * RFC 2960, 8.4 - Handle "Out of the blue" Packets.
183 * An SCTP packet is called an "out of the blue" (OOTB) 214 * An SCTP packet is called an "out of the blue" (OOTB)
@@ -187,22 +218,12 @@ int sctp_rcv(struct sk_buff *skb)
187 * packet belongs. 218 * packet belongs.
188 */ 219 */
189 if (!asoc) { 220 if (!asoc) {
190 ep = __sctp_rcv_lookup_endpoint(&dest);
191 if (sctp_rcv_ootb(skb)) { 221 if (sctp_rcv_ootb(skb)) {
192 SCTP_INC_STATS_BH(SCTP_MIB_OUTOFBLUES); 222 SCTP_INC_STATS_BH(SCTP_MIB_OUTOFBLUES);
193 goto discard_release; 223 goto discard_release;
194 } 224 }
195 } 225 }
196 226
197 /* Retrieve the common input handling substructure. */
198 rcvr = asoc ? &asoc->base : &ep->base;
199 sk = rcvr->sk;
200
201 if ((sk) && (atomic_read(&sk->sk_rmem_alloc) >= sk->sk_rcvbuf)) {
202 goto discard_release;
203 }
204
205
206 /* SCTP seems to always need a timestamp right now (FIXME) */ 227 /* SCTP seems to always need a timestamp right now (FIXME) */
207 if (skb->stamp.tv_sec == 0) { 228 if (skb->stamp.tv_sec == 0) {
208 do_gettimeofday(&skb->stamp); 229 do_gettimeofday(&skb->stamp);
@@ -265,13 +286,11 @@ discard_it:
265 286
266discard_release: 287discard_release:
267 /* Release any structures we may be holding. */ 288 /* Release any structures we may be holding. */
268 if (asoc) { 289 sock_put(sk);
269 sock_put(asoc->base.sk); 290 if (asoc)
270 sctp_association_put(asoc); 291 sctp_association_put(asoc);
271 } else { 292 else
272 sock_put(ep->base.sk);
273 sctp_endpoint_put(ep); 293 sctp_endpoint_put(ep);
274 }
275 294
276 goto discard_it; 295 goto discard_it;
277} 296}
diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
index c9d9ea064734..c7e42d125b9c 100644
--- a/net/sctp/ipv6.c
+++ b/net/sctp/ipv6.c
@@ -812,26 +812,23 @@ static int sctp_inet6_bind_verify(struct sctp_sock *opt, union sctp_addr *addr)
812 if (addr->sa.sa_family != AF_INET6) 812 if (addr->sa.sa_family != AF_INET6)
813 af = sctp_get_af_specific(addr->sa.sa_family); 813 af = sctp_get_af_specific(addr->sa.sa_family);
814 else { 814 else {
815 struct sock *sk;
816 int type = ipv6_addr_type(&addr->v6.sin6_addr); 815 int type = ipv6_addr_type(&addr->v6.sin6_addr);
817 sk = sctp_opt2sk(opt); 816 struct net_device *dev;
817
818 if (type & IPV6_ADDR_LINKLOCAL) { 818 if (type & IPV6_ADDR_LINKLOCAL) {
819 /* Note: Behavior similar to af_inet6.c: 819 if (!addr->v6.sin6_scope_id)
820 * 1) Overrides previous bound_dev_if 820 return 0;
821 * 2) Destructive even if bind isn't successful. 821 dev = dev_get_by_index(addr->v6.sin6_scope_id);
822 */ 822 if (!dev)
823
824 if (addr->v6.sin6_scope_id)
825 sk->sk_bound_dev_if = addr->v6.sin6_scope_id;
826 if (!sk->sk_bound_dev_if)
827 return 0; 823 return 0;
824 dev_put(dev);
828 } 825 }
829 af = opt->pf->af; 826 af = opt->pf->af;
830 } 827 }
831 return af->available(addr, opt); 828 return af->available(addr, opt);
832} 829}
833 830
834/* Verify that the provided sockaddr looks bindable. Common verification, 831/* Verify that the provided sockaddr looks sendable. Common verification,
835 * has already been taken care of. 832 * has already been taken care of.
836 */ 833 */
837static int sctp_inet6_send_verify(struct sctp_sock *opt, union sctp_addr *addr) 834static int sctp_inet6_send_verify(struct sctp_sock *opt, union sctp_addr *addr)
@@ -842,19 +839,16 @@ static int sctp_inet6_send_verify(struct sctp_sock *opt, union sctp_addr *addr)
842 if (addr->sa.sa_family != AF_INET6) 839 if (addr->sa.sa_family != AF_INET6)
843 af = sctp_get_af_specific(addr->sa.sa_family); 840 af = sctp_get_af_specific(addr->sa.sa_family);
844 else { 841 else {
845 struct sock *sk;
846 int type = ipv6_addr_type(&addr->v6.sin6_addr); 842 int type = ipv6_addr_type(&addr->v6.sin6_addr);
847 sk = sctp_opt2sk(opt); 843 struct net_device *dev;
844
848 if (type & IPV6_ADDR_LINKLOCAL) { 845 if (type & IPV6_ADDR_LINKLOCAL) {
849 /* Note: Behavior similar to af_inet6.c: 846 if (!addr->v6.sin6_scope_id)
850 * 1) Overrides previous bound_dev_if 847 return 0;
851 * 2) Destructive even if bind isn't successful. 848 dev = dev_get_by_index(addr->v6.sin6_scope_id);
852 */ 849 if (!dev)
853
854 if (addr->v6.sin6_scope_id)
855 sk->sk_bound_dev_if = addr->v6.sin6_scope_id;
856 if (!sk->sk_bound_dev_if)
857 return 0; 850 return 0;
851 dev_put(dev);
858 } 852 }
859 af = opt->pf->af; 853 af = opt->pf->af;
860 } 854 }
diff --git a/net/sctp/proc.c b/net/sctp/proc.c
index e42fd8c2916b..98d49ec9b74b 100644
--- a/net/sctp/proc.c
+++ b/net/sctp/proc.c
@@ -132,14 +132,25 @@ void sctp_snmp_proc_exit(void)
132static void sctp_seq_dump_local_addrs(struct seq_file *seq, struct sctp_ep_common *epb) 132static void sctp_seq_dump_local_addrs(struct seq_file *seq, struct sctp_ep_common *epb)
133{ 133{
134 struct list_head *pos; 134 struct list_head *pos;
135 struct sctp_association *asoc;
135 struct sctp_sockaddr_entry *laddr; 136 struct sctp_sockaddr_entry *laddr;
136 union sctp_addr *addr; 137 struct sctp_transport *peer;
138 union sctp_addr *addr, *primary = NULL;
137 struct sctp_af *af; 139 struct sctp_af *af;
138 140
141 if (epb->type == SCTP_EP_TYPE_ASSOCIATION) {
142 asoc = sctp_assoc(epb);
143 peer = asoc->peer.primary_path;
144 primary = &peer->saddr;
145 }
146
139 list_for_each(pos, &epb->bind_addr.address_list) { 147 list_for_each(pos, &epb->bind_addr.address_list) {
140 laddr = list_entry(pos, struct sctp_sockaddr_entry, list); 148 laddr = list_entry(pos, struct sctp_sockaddr_entry, list);
141 addr = (union sctp_addr *)&laddr->a; 149 addr = (union sctp_addr *)&laddr->a;
142 af = sctp_get_af_specific(addr->sa.sa_family); 150 af = sctp_get_af_specific(addr->sa.sa_family);
151 if (primary && af->cmp_addr(addr, primary)) {
152 seq_printf(seq, "*");
153 }
143 af->seq_dump_addr(seq, addr); 154 af->seq_dump_addr(seq, addr);
144 } 155 }
145} 156}
@@ -149,17 +160,54 @@ static void sctp_seq_dump_remote_addrs(struct seq_file *seq, struct sctp_associa
149{ 160{
150 struct list_head *pos; 161 struct list_head *pos;
151 struct sctp_transport *transport; 162 struct sctp_transport *transport;
152 union sctp_addr *addr; 163 union sctp_addr *addr, *primary;
153 struct sctp_af *af; 164 struct sctp_af *af;
154 165
166 primary = &(assoc->peer.primary_addr);
155 list_for_each(pos, &assoc->peer.transport_addr_list) { 167 list_for_each(pos, &assoc->peer.transport_addr_list) {
156 transport = list_entry(pos, struct sctp_transport, transports); 168 transport = list_entry(pos, struct sctp_transport, transports);
157 addr = (union sctp_addr *)&transport->ipaddr; 169 addr = (union sctp_addr *)&transport->ipaddr;
158 af = sctp_get_af_specific(addr->sa.sa_family); 170 af = sctp_get_af_specific(addr->sa.sa_family);
171 if (af->cmp_addr(addr, primary)) {
172 seq_printf(seq, "*");
173 }
159 af->seq_dump_addr(seq, addr); 174 af->seq_dump_addr(seq, addr);
160 } 175 }
161} 176}
162 177
178static void * sctp_eps_seq_start(struct seq_file *seq, loff_t *pos)
179{
180 if (*pos > sctp_ep_hashsize)
181 return NULL;
182
183 if (*pos < 0)
184 *pos = 0;
185
186 if (*pos == 0)
187 seq_printf(seq, " ENDPT SOCK STY SST HBKT LPORT UID INODE LADDRS\n");
188
189 ++*pos;
190
191 return (void *)pos;
192}
193
194static void sctp_eps_seq_stop(struct seq_file *seq, void *v)
195{
196 return;
197}
198
199
200static void * sctp_eps_seq_next(struct seq_file *seq, void *v, loff_t *pos)
201{
202 if (*pos > sctp_ep_hashsize)
203 return NULL;
204
205 ++*pos;
206
207 return pos;
208}
209
210
163/* Display sctp endpoints (/proc/net/sctp/eps). */ 211/* Display sctp endpoints (/proc/net/sctp/eps). */
164static int sctp_eps_seq_show(struct seq_file *seq, void *v) 212static int sctp_eps_seq_show(struct seq_file *seq, void *v)
165{ 213{
@@ -167,38 +215,50 @@ static int sctp_eps_seq_show(struct seq_file *seq, void *v)
167 struct sctp_ep_common *epb; 215 struct sctp_ep_common *epb;
168 struct sctp_endpoint *ep; 216 struct sctp_endpoint *ep;
169 struct sock *sk; 217 struct sock *sk;
170 int hash; 218 int hash = *(int *)v;
171 219
172 seq_printf(seq, " ENDPT SOCK STY SST HBKT LPORT LADDRS\n"); 220 if (hash > sctp_ep_hashsize)
173 for (hash = 0; hash < sctp_ep_hashsize; hash++) { 221 return -ENOMEM;
174 head = &sctp_ep_hashtable[hash]; 222
175 read_lock(&head->lock); 223 head = &sctp_ep_hashtable[hash-1];
176 for (epb = head->chain; epb; epb = epb->next) { 224 sctp_local_bh_disable();
177 ep = sctp_ep(epb); 225 read_lock(&head->lock);
178 sk = epb->sk; 226 for (epb = head->chain; epb; epb = epb->next) {
179 seq_printf(seq, "%8p %8p %-3d %-3d %-4d %-5d ", ep, sk, 227 ep = sctp_ep(epb);
180 sctp_sk(sk)->type, sk->sk_state, hash, 228 sk = epb->sk;
181 epb->bind_addr.port); 229 seq_printf(seq, "%8p %8p %-3d %-3d %-4d %-5d %5d %5lu ", ep, sk,
182 sctp_seq_dump_local_addrs(seq, epb); 230 sctp_sk(sk)->type, sk->sk_state, hash-1,
183 seq_printf(seq, "\n"); 231 epb->bind_addr.port,
184 } 232 sock_i_uid(sk), sock_i_ino(sk));
185 read_unlock(&head->lock); 233
234 sctp_seq_dump_local_addrs(seq, epb);
235 seq_printf(seq, "\n");
186 } 236 }
237 read_unlock(&head->lock);
238 sctp_local_bh_enable();
187 239
188 return 0; 240 return 0;
189} 241}
190 242
243static struct seq_operations sctp_eps_ops = {
244 .start = sctp_eps_seq_start,
245 .next = sctp_eps_seq_next,
246 .stop = sctp_eps_seq_stop,
247 .show = sctp_eps_seq_show,
248};
249
250
191/* Initialize the seq file operations for 'eps' object. */ 251/* Initialize the seq file operations for 'eps' object. */
192static int sctp_eps_seq_open(struct inode *inode, struct file *file) 252static int sctp_eps_seq_open(struct inode *inode, struct file *file)
193{ 253{
194 return single_open(file, sctp_eps_seq_show, NULL); 254 return seq_open(file, &sctp_eps_ops);
195} 255}
196 256
197static struct file_operations sctp_eps_seq_fops = { 257static struct file_operations sctp_eps_seq_fops = {
198 .open = sctp_eps_seq_open, 258 .open = sctp_eps_seq_open,
199 .read = seq_read, 259 .read = seq_read,
200 .llseek = seq_lseek, 260 .llseek = seq_lseek,
201 .release = single_release, 261 .release = seq_release,
202}; 262};
203 263
204/* Set up the proc fs entry for 'eps' object. */ 264/* Set up the proc fs entry for 'eps' object. */
@@ -221,6 +281,40 @@ void sctp_eps_proc_exit(void)
221 remove_proc_entry("eps", proc_net_sctp); 281 remove_proc_entry("eps", proc_net_sctp);
222} 282}
223 283
284
285static void * sctp_assocs_seq_start(struct seq_file *seq, loff_t *pos)
286{
287 if (*pos > sctp_assoc_hashsize)
288 return NULL;
289
290 if (*pos < 0)
291 *pos = 0;
292
293 if (*pos == 0)
294 seq_printf(seq, " ASSOC SOCK STY SST ST HBKT ASSOC-ID TX_QUEUE RX_QUEUE UID INODE LPORT "
295 "RPORT LADDRS <-> RADDRS\n");
296
297 ++*pos;
298
299 return (void *)pos;
300}
301
302static void sctp_assocs_seq_stop(struct seq_file *seq, void *v)
303{
304 return;
305}
306
307
308static void * sctp_assocs_seq_next(struct seq_file *seq, void *v, loff_t *pos)
309{
310 if (*pos > sctp_assoc_hashsize)
311 return NULL;
312
313 ++*pos;
314
315 return pos;
316}
317
224/* Display sctp associations (/proc/net/sctp/assocs). */ 318/* Display sctp associations (/proc/net/sctp/assocs). */
225static int sctp_assocs_seq_show(struct seq_file *seq, void *v) 319static int sctp_assocs_seq_show(struct seq_file *seq, void *v)
226{ 320{
@@ -228,43 +322,57 @@ static int sctp_assocs_seq_show(struct seq_file *seq, void *v)
228 struct sctp_ep_common *epb; 322 struct sctp_ep_common *epb;
229 struct sctp_association *assoc; 323 struct sctp_association *assoc;
230 struct sock *sk; 324 struct sock *sk;
231 int hash; 325 int hash = *(int *)v;
232 326
233 seq_printf(seq, " ASSOC SOCK STY SST ST HBKT LPORT RPORT " 327 if (hash > sctp_assoc_hashsize)
234 "LADDRS <-> RADDRS\n"); 328 return -ENOMEM;
235 for (hash = 0; hash < sctp_assoc_hashsize; hash++) { 329
236 head = &sctp_assoc_hashtable[hash]; 330 head = &sctp_assoc_hashtable[hash-1];
237 read_lock(&head->lock); 331 sctp_local_bh_disable();
238 for (epb = head->chain; epb; epb = epb->next) { 332 read_lock(&head->lock);
239 assoc = sctp_assoc(epb); 333 for (epb = head->chain; epb; epb = epb->next) {
240 sk = epb->sk; 334 assoc = sctp_assoc(epb);
241 seq_printf(seq, 335 sk = epb->sk;
242 "%8p %8p %-3d %-3d %-2d %-4d %-5d %-5d ", 336 seq_printf(seq,
243 assoc, sk, sctp_sk(sk)->type, sk->sk_state, 337 "%8p %8p %-3d %-3d %-2d %-4d %4d %8d %8d %7d %5lu %-5d %5d ",
244 assoc->state, hash, epb->bind_addr.port, 338 assoc, sk, sctp_sk(sk)->type, sk->sk_state,
245 assoc->peer.port); 339 assoc->state, hash-1, assoc->assoc_id,
246 sctp_seq_dump_local_addrs(seq, epb); 340 (sk->sk_rcvbuf - assoc->rwnd),
247 seq_printf(seq, "<-> "); 341 assoc->sndbuf_used,
248 sctp_seq_dump_remote_addrs(seq, assoc); 342 sock_i_uid(sk), sock_i_ino(sk),
249 seq_printf(seq, "\n"); 343 epb->bind_addr.port,
250 } 344 assoc->peer.port);
251 read_unlock(&head->lock); 345
346 seq_printf(seq, " ");
347 sctp_seq_dump_local_addrs(seq, epb);
348 seq_printf(seq, "<-> ");
349 sctp_seq_dump_remote_addrs(seq, assoc);
350 seq_printf(seq, "\n");
252 } 351 }
352 read_unlock(&head->lock);
353 sctp_local_bh_enable();
253 354
254 return 0; 355 return 0;
255} 356}
256 357
358static struct seq_operations sctp_assoc_ops = {
359 .start = sctp_assocs_seq_start,
360 .next = sctp_assocs_seq_next,
361 .stop = sctp_assocs_seq_stop,
362 .show = sctp_assocs_seq_show,
363};
364
257/* Initialize the seq file operations for 'assocs' object. */ 365/* Initialize the seq file operations for 'assocs' object. */
258static int sctp_assocs_seq_open(struct inode *inode, struct file *file) 366static int sctp_assocs_seq_open(struct inode *inode, struct file *file)
259{ 367{
260 return single_open(file, sctp_assocs_seq_show, NULL); 368 return seq_open(file, &sctp_assoc_ops);
261} 369}
262 370
263static struct file_operations sctp_assocs_seq_fops = { 371static struct file_operations sctp_assocs_seq_fops = {
264 .open = sctp_assocs_seq_open, 372 .open = sctp_assocs_seq_open,
265 .read = seq_read, 373 .read = seq_read,
266 .llseek = seq_lseek, 374 .llseek = seq_lseek,
267 .release = single_release, 375 .release = seq_release,
268}; 376};
269 377
270/* Set up the proc fs entry for 'assocs' object. */ 378/* Set up the proc fs entry for 'assocs' object. */
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index 2e1f9c3556f5..5135e1a25d25 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -378,10 +378,13 @@ static int sctp_v4_available(union sctp_addr *addr, struct sctp_sock *sp)
378{ 378{
379 int ret = inet_addr_type(addr->v4.sin_addr.s_addr); 379 int ret = inet_addr_type(addr->v4.sin_addr.s_addr);
380 380
381 /* FIXME: ip_nonlocal_bind sysctl support. */
382 381
383 if (addr->v4.sin_addr.s_addr != INADDR_ANY && ret != RTN_LOCAL) 382 if (addr->v4.sin_addr.s_addr != INADDR_ANY &&
383 ret != RTN_LOCAL &&
384 !sp->inet.freebind &&
385 !sysctl_ip_nonlocal_bind)
384 return 0; 386 return 0;
387
385 return 1; 388 return 1;
386} 389}
387 390
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 0b338eca6dc0..2a3c0e08a090 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -4686,6 +4686,7 @@ static void sctp_sock_migrate(struct sock *oldsk, struct sock *newsk,
4686 struct sctp_endpoint *newep = newsp->ep; 4686 struct sctp_endpoint *newep = newsp->ep;
4687 struct sk_buff *skb, *tmp; 4687 struct sk_buff *skb, *tmp;
4688 struct sctp_ulpevent *event; 4688 struct sctp_ulpevent *event;
4689 int flags = 0;
4689 4690
4690 /* Migrate socket buffer sizes and all the socket level options to the 4691 /* Migrate socket buffer sizes and all the socket level options to the
4691 * new socket. 4692 * new socket.
@@ -4707,6 +4708,17 @@ static void sctp_sock_migrate(struct sock *oldsk, struct sock *newsk,
4707 sctp_sk(newsk)->bind_hash = pp; 4708 sctp_sk(newsk)->bind_hash = pp;
4708 inet_sk(newsk)->num = inet_sk(oldsk)->num; 4709 inet_sk(newsk)->num = inet_sk(oldsk)->num;
4709 4710
4711 /* Copy the bind_addr list from the original endpoint to the new
4712 * endpoint so that we can handle restarts properly
4713 */
4714 if (assoc->peer.ipv4_address)
4715 flags |= SCTP_ADDR4_PEERSUPP;
4716 if (assoc->peer.ipv6_address)
4717 flags |= SCTP_ADDR6_PEERSUPP;
4718 sctp_bind_addr_copy(&newsp->ep->base.bind_addr,
4719 &oldsp->ep->base.bind_addr,
4720 SCTP_SCOPE_GLOBAL, GFP_KERNEL, flags);
4721
4710 /* Move any messages in the old socket's receive queue that are for the 4722 /* Move any messages in the old socket's receive queue that are for the
4711 * peeled off association to the new socket's receive queue. 4723 * peeled off association to the new socket's receive queue.
4712 */ 4724 */