aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/bridge/br_fdb.c2
-rw-r--r--net/core/netpoll.c6
-rw-r--r--net/ipv4/netfilter/ipt_recent.c2
-rw-r--r--net/ipv4/tcp_output.c2
-rw-r--r--net/ipv6/Kconfig5
-rw-r--r--net/netfilter/nf_conntrack_h323_main.c2
-rw-r--r--net/sctp/ipv6.c32
-rw-r--r--net/sctp/protocol.c129
8 files changed, 116 insertions, 64 deletions
diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c
index bc40377136a2..9326c377822e 100644
--- a/net/bridge/br_fdb.c
+++ b/net/bridge/br_fdb.c
@@ -136,7 +136,7 @@ void br_fdb_cleanup(unsigned long _data)
136 this_timer = f->ageing_timer + delay; 136 this_timer = f->ageing_timer + delay;
137 if (time_before_eq(this_timer, jiffies)) 137 if (time_before_eq(this_timer, jiffies))
138 fdb_delete(f); 138 fdb_delete(f);
139 else if (this_timer < next_timer) 139 else if (time_before(this_timer, next_timer))
140 next_timer = this_timer; 140 next_timer = this_timer;
141 } 141 }
142 } 142 }
diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index d0c8bf585f06..b04d643fc3c7 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -215,10 +215,12 @@ static void zap_completion_queue(void)
215 while (clist != NULL) { 215 while (clist != NULL) {
216 struct sk_buff *skb = clist; 216 struct sk_buff *skb = clist;
217 clist = clist->next; 217 clist = clist->next;
218 if (skb->destructor) 218 if (skb->destructor) {
219 atomic_inc(&skb->users);
219 dev_kfree_skb_any(skb); /* put this one back */ 220 dev_kfree_skb_any(skb); /* put this one back */
220 else 221 } else {
221 __kfree_skb(skb); 222 __kfree_skb(skb);
223 }
222 } 224 }
223 } 225 }
224 226
diff --git a/net/ipv4/netfilter/ipt_recent.c b/net/ipv4/netfilter/ipt_recent.c
index 68cbe3ca01ce..8e8f0425a8ed 100644
--- a/net/ipv4/netfilter/ipt_recent.c
+++ b/net/ipv4/netfilter/ipt_recent.c
@@ -252,6 +252,8 @@ recent_mt_check(const char *tablename, const void *ip,
252 if ((info->check_set & (IPT_RECENT_SET | IPT_RECENT_REMOVE)) && 252 if ((info->check_set & (IPT_RECENT_SET | IPT_RECENT_REMOVE)) &&
253 (info->seconds || info->hit_count)) 253 (info->seconds || info->hit_count))
254 return false; 254 return false;
255 if (info->hit_count > ip_pkt_list_tot)
256 return false;
255 if (info->name[0] == '\0' || 257 if (info->name[0] == '\0' ||
256 strnlen(info->name, IPT_RECENT_NAME_LEN) == IPT_RECENT_NAME_LEN) 258 strnlen(info->name, IPT_RECENT_NAME_LEN) == IPT_RECENT_NAME_LEN)
257 return false; 259 return false;
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 67f84f5035c4..b4e11d834c9f 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -255,7 +255,7 @@ static u16 tcp_select_window(struct sock *sk)
255 * 255 *
256 * Relax Will Robinson. 256 * Relax Will Robinson.
257 */ 257 */
258 new_win = cur_win; 258 new_win = ALIGN(cur_win, 1 << tp->rx_opt.rcv_wscale);
259 } 259 }
260 tp->rcv_wnd = new_win; 260 tp->rcv_wnd = new_win;
261 tp->rcv_wup = tp->rcv_nxt; 261 tp->rcv_wup = tp->rcv_nxt;
diff --git a/net/ipv6/Kconfig b/net/ipv6/Kconfig
index 58219dfffef8..47263e45bacb 100644
--- a/net/ipv6/Kconfig
+++ b/net/ipv6/Kconfig
@@ -179,11 +179,12 @@ config IPV6_SIT
179 Saying M here will produce a module called sit.ko. If unsure, say Y. 179 Saying M here will produce a module called sit.ko. If unsure, say Y.
180 180
181config IPV6_TUNNEL 181config IPV6_TUNNEL
182 tristate "IPv6: IPv6-in-IPv6 tunnel" 182 tristate "IPv6: IP-in-IPv6 tunnel (RFC2473)"
183 select INET6_TUNNEL 183 select INET6_TUNNEL
184 depends on IPV6 184 depends on IPV6
185 ---help--- 185 ---help---
186 Support for IPv6-in-IPv6 tunnels described in RFC 2473. 186 Support for IPv6-in-IPv6 and IPv4-in-IPv6 tunnels described in
187 RFC 2473.
187 188
188 If unsure, say N. 189 If unsure, say N.
189 190
diff --git a/net/netfilter/nf_conntrack_h323_main.c b/net/netfilter/nf_conntrack_h323_main.c
index 62137879e6aa..898f1922b5b8 100644
--- a/net/netfilter/nf_conntrack_h323_main.c
+++ b/net/netfilter/nf_conntrack_h323_main.c
@@ -842,7 +842,7 @@ static int process_setup(struct sk_buff *skb, struct nf_conn *ct,
842 842
843 set_h225_addr = rcu_dereference(set_h225_addr_hook); 843 set_h225_addr = rcu_dereference(set_h225_addr_hook);
844 if ((setup->options & eSetup_UUIE_destCallSignalAddress) && 844 if ((setup->options & eSetup_UUIE_destCallSignalAddress) &&
845 (set_h225_addr) && ct->status && IPS_NAT_MASK && 845 (set_h225_addr) && ct->status & IPS_NAT_MASK &&
846 get_h225_addr(ct, *data, &setup->destCallSignalAddress, 846 get_h225_addr(ct, *data, &setup->destCallSignalAddress,
847 &addr, &port) && 847 &addr, &port) &&
848 memcmp(&addr, &ct->tuplehash[!dir].tuple.src.u3, sizeof(addr))) { 848 memcmp(&addr, &ct->tuplehash[!dir].tuple.src.u3, sizeof(addr))) {
diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
index 1937be583cd7..46c5b3c5cb99 100644
--- a/net/sctp/ipv6.c
+++ b/net/sctp/ipv6.c
@@ -1015,15 +1015,24 @@ static struct sctp_pf sctp_pf_inet6 = {
1015}; 1015};
1016 1016
1017/* Initialize IPv6 support and register with socket layer. */ 1017/* Initialize IPv6 support and register with socket layer. */
1018int sctp_v6_init(void) 1018void sctp_v6_pf_init(void)
1019{ 1019{
1020 int rc;
1021
1022 /* Register the SCTP specific PF_INET6 functions. */ 1020 /* Register the SCTP specific PF_INET6 functions. */
1023 sctp_register_pf(&sctp_pf_inet6, PF_INET6); 1021 sctp_register_pf(&sctp_pf_inet6, PF_INET6);
1024 1022
1025 /* Register the SCTP specific AF_INET6 functions. */ 1023 /* Register the SCTP specific AF_INET6 functions. */
1026 sctp_register_af(&sctp_af_inet6); 1024 sctp_register_af(&sctp_af_inet6);
1025}
1026
1027void sctp_v6_pf_exit(void)
1028{
1029 list_del(&sctp_af_inet6.list);
1030}
1031
1032/* Initialize IPv6 support and register with socket layer. */
1033int sctp_v6_protosw_init(void)
1034{
1035 int rc;
1027 1036
1028 rc = proto_register(&sctpv6_prot, 1); 1037 rc = proto_register(&sctpv6_prot, 1);
1029 if (rc) 1038 if (rc)
@@ -1036,6 +1045,14 @@ int sctp_v6_init(void)
1036 return 0; 1045 return 0;
1037} 1046}
1038 1047
1048void sctp_v6_protosw_exit(void)
1049{
1050 inet6_unregister_protosw(&sctpv6_seqpacket_protosw);
1051 inet6_unregister_protosw(&sctpv6_stream_protosw);
1052 proto_unregister(&sctpv6_prot);
1053}
1054
1055
1039/* Register with inet6 layer. */ 1056/* Register with inet6 layer. */
1040int sctp_v6_add_protocol(void) 1057int sctp_v6_add_protocol(void)
1041{ 1058{
@@ -1048,15 +1065,6 @@ int sctp_v6_add_protocol(void)
1048 return 0; 1065 return 0;
1049} 1066}
1050 1067
1051/* IPv6 specific exit support. */
1052void sctp_v6_exit(void)
1053{
1054 inet6_unregister_protosw(&sctpv6_seqpacket_protosw);
1055 inet6_unregister_protosw(&sctpv6_stream_protosw);
1056 proto_unregister(&sctpv6_prot);
1057 list_del(&sctp_af_inet6.list);
1058}
1059
1060/* Unregister with inet6 layer. */ 1068/* Unregister with inet6 layer. */
1061void sctp_v6_del_protocol(void) 1069void sctp_v6_del_protocol(void)
1062{ 1070{
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index 25be8f04de6e..beea2fb18b15 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -995,6 +995,58 @@ static void cleanup_sctp_mibs(void)
995 free_percpu(sctp_statistics[1]); 995 free_percpu(sctp_statistics[1]);
996} 996}
997 997
998static void sctp_v4_pf_init(void)
999{
1000 /* Initialize the SCTP specific PF functions. */
1001 sctp_register_pf(&sctp_pf_inet, PF_INET);
1002 sctp_register_af(&sctp_af_inet);
1003}
1004
1005static void sctp_v4_pf_exit(void)
1006{
1007 list_del(&sctp_af_inet.list);
1008}
1009
1010static int sctp_v4_protosw_init(void)
1011{
1012 int rc;
1013
1014 rc = proto_register(&sctp_prot, 1);
1015 if (rc)
1016 return rc;
1017
1018 /* Register SCTP(UDP and TCP style) with socket layer. */
1019 inet_register_protosw(&sctp_seqpacket_protosw);
1020 inet_register_protosw(&sctp_stream_protosw);
1021
1022 return 0;
1023}
1024
1025static void sctp_v4_protosw_exit(void)
1026{
1027 inet_unregister_protosw(&sctp_stream_protosw);
1028 inet_unregister_protosw(&sctp_seqpacket_protosw);
1029 proto_unregister(&sctp_prot);
1030}
1031
1032static int sctp_v4_add_protocol(void)
1033{
1034 /* Register notifier for inet address additions/deletions. */
1035 register_inetaddr_notifier(&sctp_inetaddr_notifier);
1036
1037 /* Register SCTP with inet layer. */
1038 if (inet_add_protocol(&sctp_protocol, IPPROTO_SCTP) < 0)
1039 return -EAGAIN;
1040
1041 return 0;
1042}
1043
1044static void sctp_v4_del_protocol(void)
1045{
1046 inet_del_protocol(&sctp_protocol, IPPROTO_SCTP);
1047 unregister_inetaddr_notifier(&sctp_inetaddr_notifier);
1048}
1049
998/* Initialize the universe into something sensible. */ 1050/* Initialize the universe into something sensible. */
999SCTP_STATIC __init int sctp_init(void) 1051SCTP_STATIC __init int sctp_init(void)
1000{ 1052{
@@ -1038,8 +1090,6 @@ SCTP_STATIC __init int sctp_init(void)
1038 /* Initialize object count debugging. */ 1090 /* Initialize object count debugging. */
1039 sctp_dbg_objcnt_init(); 1091 sctp_dbg_objcnt_init();
1040 1092
1041 /* Initialize the SCTP specific PF functions. */
1042 sctp_register_pf(&sctp_pf_inet, PF_INET);
1043 /* 1093 /*
1044 * 14. Suggested SCTP Protocol Parameter Values 1094 * 14. Suggested SCTP Protocol Parameter Values
1045 */ 1095 */
@@ -1197,19 +1247,22 @@ SCTP_STATIC __init int sctp_init(void)
1197 sctp_sysctl_register(); 1247 sctp_sysctl_register();
1198 1248
1199 INIT_LIST_HEAD(&sctp_address_families); 1249 INIT_LIST_HEAD(&sctp_address_families);
1200 sctp_register_af(&sctp_af_inet); 1250 sctp_v4_pf_init();
1251 sctp_v6_pf_init();
1201 1252
1202 status = proto_register(&sctp_prot, 1); 1253 /* Initialize the local address list. */
1203 if (status) 1254 INIT_LIST_HEAD(&sctp_local_addr_list);
1204 goto err_proto_register; 1255 spin_lock_init(&sctp_local_addr_lock);
1256 sctp_get_local_addr_list();
1205 1257
1206 /* Register SCTP(UDP and TCP style) with socket layer. */ 1258 status = sctp_v4_protosw_init();
1207 inet_register_protosw(&sctp_seqpacket_protosw);
1208 inet_register_protosw(&sctp_stream_protosw);
1209 1259
1210 status = sctp_v6_init();
1211 if (status) 1260 if (status)
1212 goto err_v6_init; 1261 goto err_protosw_init;
1262
1263 status = sctp_v6_protosw_init();
1264 if (status)
1265 goto err_v6_protosw_init;
1213 1266
1214 /* Initialize the control inode/socket for handling OOTB packets. */ 1267 /* Initialize the control inode/socket for handling OOTB packets. */
1215 if ((status = sctp_ctl_sock_init())) { 1268 if ((status = sctp_ctl_sock_init())) {
@@ -1218,19 +1271,9 @@ SCTP_STATIC __init int sctp_init(void)
1218 goto err_ctl_sock_init; 1271 goto err_ctl_sock_init;
1219 } 1272 }
1220 1273
1221 /* Initialize the local address list. */ 1274 status = sctp_v4_add_protocol();
1222 INIT_LIST_HEAD(&sctp_local_addr_list); 1275 if (status)
1223 spin_lock_init(&sctp_local_addr_lock);
1224 sctp_get_local_addr_list();
1225
1226 /* Register notifier for inet address additions/deletions. */
1227 register_inetaddr_notifier(&sctp_inetaddr_notifier);
1228
1229 /* Register SCTP with inet layer. */
1230 if (inet_add_protocol(&sctp_protocol, IPPROTO_SCTP) < 0) {
1231 status = -EAGAIN;
1232 goto err_add_protocol; 1276 goto err_add_protocol;
1233 }
1234 1277
1235 /* Register SCTP with inet6 layer. */ 1278 /* Register SCTP with inet6 layer. */
1236 status = sctp_v6_add_protocol(); 1279 status = sctp_v6_add_protocol();
@@ -1241,18 +1284,18 @@ SCTP_STATIC __init int sctp_init(void)
1241out: 1284out:
1242 return status; 1285 return status;
1243err_v6_add_protocol: 1286err_v6_add_protocol:
1244 inet_del_protocol(&sctp_protocol, IPPROTO_SCTP); 1287 sctp_v6_del_protocol();
1245 unregister_inetaddr_notifier(&sctp_inetaddr_notifier);
1246err_add_protocol: 1288err_add_protocol:
1247 sctp_free_local_addr_list(); 1289 sctp_v4_del_protocol();
1248 sock_release(sctp_ctl_socket); 1290 sock_release(sctp_ctl_socket);
1249err_ctl_sock_init: 1291err_ctl_sock_init:
1250 sctp_v6_exit(); 1292 sctp_v6_protosw_exit();
1251err_v6_init: 1293err_v6_protosw_init:
1252 inet_unregister_protosw(&sctp_stream_protosw); 1294 sctp_v4_protosw_exit();
1253 inet_unregister_protosw(&sctp_seqpacket_protosw); 1295err_protosw_init:
1254 proto_unregister(&sctp_prot); 1296 sctp_free_local_addr_list();
1255err_proto_register: 1297 sctp_v4_pf_exit();
1298 sctp_v6_pf_exit();
1256 sctp_sysctl_unregister(); 1299 sctp_sysctl_unregister();
1257 list_del(&sctp_af_inet.list); 1300 list_del(&sctp_af_inet.list);
1258 free_pages((unsigned long)sctp_port_hashtable, 1301 free_pages((unsigned long)sctp_port_hashtable,
@@ -1285,23 +1328,21 @@ SCTP_STATIC __exit void sctp_exit(void)
1285 1328
1286 /* Unregister with inet6/inet layers. */ 1329 /* Unregister with inet6/inet layers. */
1287 sctp_v6_del_protocol(); 1330 sctp_v6_del_protocol();
1288 inet_del_protocol(&sctp_protocol, IPPROTO_SCTP); 1331 sctp_v4_del_protocol();
1289
1290 /* Unregister notifier for inet address additions/deletions. */
1291 unregister_inetaddr_notifier(&sctp_inetaddr_notifier);
1292
1293 /* Free the local address list. */
1294 sctp_free_local_addr_list();
1295 1332
1296 /* Free the control endpoint. */ 1333 /* Free the control endpoint. */
1297 sock_release(sctp_ctl_socket); 1334 sock_release(sctp_ctl_socket);
1298 1335
1299 /* Cleanup v6 initializations. */ 1336 /* Free protosw registrations */
1300 sctp_v6_exit(); 1337 sctp_v6_protosw_exit();
1338 sctp_v4_protosw_exit();
1339
1340 /* Free the local address list. */
1341 sctp_free_local_addr_list();
1301 1342
1302 /* Unregister with socket layer. */ 1343 /* Unregister with socket layer. */
1303 inet_unregister_protosw(&sctp_stream_protosw); 1344 sctp_v6_pf_exit();
1304 inet_unregister_protosw(&sctp_seqpacket_protosw); 1345 sctp_v4_pf_exit();
1305 1346
1306 sctp_sysctl_unregister(); 1347 sctp_sysctl_unregister();
1307 list_del(&sctp_af_inet.list); 1348 list_del(&sctp_af_inet.list);
@@ -1320,8 +1361,6 @@ SCTP_STATIC __exit void sctp_exit(void)
1320 1361
1321 kmem_cache_destroy(sctp_chunk_cachep); 1362 kmem_cache_destroy(sctp_chunk_cachep);
1322 kmem_cache_destroy(sctp_bucket_cachep); 1363 kmem_cache_destroy(sctp_bucket_cachep);
1323
1324 proto_unregister(&sctp_prot);
1325} 1364}
1326 1365
1327module_init(sctp_init); 1366module_init(sctp_init);