aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/inet_fragment.c2
-rw-r--r--net/ipv4/ip_fragment.c20
2 files changed, 11 insertions, 11 deletions
diff --git a/net/ipv4/inet_fragment.c b/net/ipv4/inet_fragment.c
index ad79ae0c0264..9da96792fffb 100644
--- a/net/ipv4/inet_fragment.c
+++ b/net/ipv4/inet_fragment.c
@@ -206,7 +206,7 @@ static struct inet_frag_queue *inet_frag_intern(struct netns_frags *nf,
206 } 206 }
207#endif 207#endif
208 qp = qp_in; 208 qp = qp_in;
209 if (!mod_timer(&qp->timer, jiffies + f->ctl->timeout)) 209 if (!mod_timer(&qp->timer, jiffies + nf->timeout))
210 atomic_inc(&qp->refcnt); 210 atomic_inc(&qp->refcnt);
211 211
212 atomic_inc(&qp->refcnt); 212 atomic_inc(&qp->refcnt);
diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c
index c51e1a11dc6b..70d241c8d2a8 100644
--- a/net/ipv4/ip_fragment.c
+++ b/net/ipv4/ip_fragment.c
@@ -83,13 +83,6 @@ static struct inet_frags_ctl ip4_frags_ctl __read_mostly = {
83 */ 83 */
84 .high_thresh = 256 * 1024, 84 .high_thresh = 256 * 1024,
85 .low_thresh = 192 * 1024, 85 .low_thresh = 192 * 1024,
86
87 /*
88 * Important NOTE! Fragment queue must be destroyed before MSL expires.
89 * RFC791 is wrong proposing to prolongate timer each fragment arrival
90 * by TTL.
91 */
92 .timeout = IP_FRAG_TIME,
93 .secret_interval = 10 * 60 * HZ, 86 .secret_interval = 10 * 60 * HZ,
94}; 87};
95 88
@@ -287,7 +280,7 @@ static int ip_frag_reinit(struct ipq *qp)
287{ 280{
288 struct sk_buff *fp; 281 struct sk_buff *fp;
289 282
290 if (!mod_timer(&qp->q.timer, jiffies + ip4_frags_ctl.timeout)) { 283 if (!mod_timer(&qp->q.timer, jiffies + qp->q.net->timeout)) {
291 atomic_inc(&qp->q.refcnt); 284 atomic_inc(&qp->q.refcnt);
292 return -ETIMEDOUT; 285 return -ETIMEDOUT;
293 } 286 }
@@ -633,7 +626,7 @@ static struct ctl_table ip4_frags_ctl_table[] = {
633 { 626 {
634 .ctl_name = NET_IPV4_IPFRAG_TIME, 627 .ctl_name = NET_IPV4_IPFRAG_TIME,
635 .procname = "ipfrag_time", 628 .procname = "ipfrag_time",
636 .data = &ip4_frags_ctl.timeout, 629 .data = &init_net.ipv4.frags.timeout,
637 .maxlen = sizeof(int), 630 .maxlen = sizeof(int),
638 .mode = 0644, 631 .mode = 0644,
639 .proc_handler = &proc_dointvec_jiffies, 632 .proc_handler = &proc_dointvec_jiffies,
@@ -672,7 +665,7 @@ static int ip4_frags_ctl_register(struct net *net)
672 665
673 table[0].mode &= ~0222; 666 table[0].mode &= ~0222;
674 table[1].mode &= ~0222; 667 table[1].mode &= ~0222;
675 table[2].mode &= ~0222; 668 table[2].data = &net->ipv4.frags.timeout;
676 table[3].mode &= ~0222; 669 table[3].mode &= ~0222;
677 table[4].mode &= ~0222; 670 table[4].mode &= ~0222;
678 } 671 }
@@ -712,6 +705,13 @@ static inline void ip4_frags_ctl_unregister(struct net *net)
712 705
713static int ipv4_frags_init_net(struct net *net) 706static int ipv4_frags_init_net(struct net *net)
714{ 707{
708 /*
709 * Important NOTE! Fragment queue must be destroyed before MSL expires.
710 * RFC791 is wrong proposing to prolongate timer each fragment arrival
711 * by TTL.
712 */
713 net->ipv4.frags.timeout = IP_FRAG_TIME;
714
715 inet_frags_init_net(&net->ipv4.frags); 715 inet_frags_init_net(&net->ipv4.frags);
716 716
717 return ip4_frags_ctl_register(net); 717 return ip4_frags_ctl_register(net);