diff options
| author | Jens Axboe <axboe@kernel.dk> | 2012-07-30 03:03:10 -0400 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2012-07-30 03:03:10 -0400 |
| commit | 72ea1f74fcdf874cca6d2c0962379523bbd99e2c (patch) | |
| tree | 4c67be6c73356086ff44ef1b8b1c9479702689ca /net/ipv4 | |
| parent | b1af9be5ef77898c05667bb9dbf3b180d91d3292 (diff) | |
| parent | a73ff3231df59a4b92ccd0dd4e73897c5822489b (diff) | |
Merge branch 'for-jens' of git://git.drbd.org/linux-drbd into for-3.6/drivers
Diffstat (limited to 'net/ipv4')
| -rw-r--r-- | net/ipv4/cipso_ipv4.c | 6 | ||||
| -rw-r--r-- | net/ipv4/inetpeer.c | 16 | ||||
| -rw-r--r-- | net/ipv4/ip_forward.c | 1 | ||||
| -rw-r--r-- | net/ipv4/ipmr.c | 1 |
4 files changed, 18 insertions, 6 deletions
diff --git a/net/ipv4/cipso_ipv4.c b/net/ipv4/cipso_ipv4.c index c48adc565e92..667c1d4ca984 100644 --- a/net/ipv4/cipso_ipv4.c +++ b/net/ipv4/cipso_ipv4.c | |||
| @@ -1725,8 +1725,10 @@ int cipso_v4_validate(const struct sk_buff *skb, unsigned char **option) | |||
| 1725 | case CIPSO_V4_TAG_LOCAL: | 1725 | case CIPSO_V4_TAG_LOCAL: |
| 1726 | /* This is a non-standard tag that we only allow for | 1726 | /* This is a non-standard tag that we only allow for |
| 1727 | * local connections, so if the incoming interface is | 1727 | * local connections, so if the incoming interface is |
| 1728 | * not the loopback device drop the packet. */ | 1728 | * not the loopback device drop the packet. Further, |
| 1729 | if (!(skb->dev->flags & IFF_LOOPBACK)) { | 1729 | * there is no legitimate reason for setting this from |
| 1730 | * userspace so reject it if skb is NULL. */ | ||
| 1731 | if (skb == NULL || !(skb->dev->flags & IFF_LOOPBACK)) { | ||
| 1730 | err_offset = opt_iter; | 1732 | err_offset = opt_iter; |
| 1731 | goto validate_return_locked; | 1733 | goto validate_return_locked; |
| 1732 | } | 1734 | } |
diff --git a/net/ipv4/inetpeer.c b/net/ipv4/inetpeer.c index d4d61b694fab..dfba343b2509 100644 --- a/net/ipv4/inetpeer.c +++ b/net/ipv4/inetpeer.c | |||
| @@ -560,6 +560,17 @@ bool inet_peer_xrlim_allow(struct inet_peer *peer, int timeout) | |||
| 560 | } | 560 | } |
| 561 | EXPORT_SYMBOL(inet_peer_xrlim_allow); | 561 | EXPORT_SYMBOL(inet_peer_xrlim_allow); |
| 562 | 562 | ||
| 563 | static void inetpeer_inval_rcu(struct rcu_head *head) | ||
| 564 | { | ||
| 565 | struct inet_peer *p = container_of(head, struct inet_peer, gc_rcu); | ||
| 566 | |||
| 567 | spin_lock_bh(&gc_lock); | ||
| 568 | list_add_tail(&p->gc_list, &gc_list); | ||
| 569 | spin_unlock_bh(&gc_lock); | ||
| 570 | |||
| 571 | schedule_delayed_work(&gc_work, gc_delay); | ||
| 572 | } | ||
| 573 | |||
| 563 | void inetpeer_invalidate_tree(int family) | 574 | void inetpeer_invalidate_tree(int family) |
| 564 | { | 575 | { |
| 565 | struct inet_peer *old, *new, *prev; | 576 | struct inet_peer *old, *new, *prev; |
| @@ -576,10 +587,7 @@ void inetpeer_invalidate_tree(int family) | |||
| 576 | prev = cmpxchg(&base->root, old, new); | 587 | prev = cmpxchg(&base->root, old, new); |
| 577 | if (prev == old) { | 588 | if (prev == old) { |
| 578 | base->total = 0; | 589 | base->total = 0; |
| 579 | spin_lock(&gc_lock); | 590 | call_rcu(&prev->gc_rcu, inetpeer_inval_rcu); |
| 580 | list_add_tail(&prev->gc_list, &gc_list); | ||
| 581 | spin_unlock(&gc_lock); | ||
| 582 | schedule_delayed_work(&gc_work, gc_delay); | ||
| 583 | } | 591 | } |
| 584 | 592 | ||
| 585 | out: | 593 | out: |
diff --git a/net/ipv4/ip_forward.c b/net/ipv4/ip_forward.c index e5c44fc586ab..ab09b126423c 100644 --- a/net/ipv4/ip_forward.c +++ b/net/ipv4/ip_forward.c | |||
| @@ -44,6 +44,7 @@ static int ip_forward_finish(struct sk_buff *skb) | |||
| 44 | struct ip_options *opt = &(IPCB(skb)->opt); | 44 | struct ip_options *opt = &(IPCB(skb)->opt); |
| 45 | 45 | ||
| 46 | IP_INC_STATS_BH(dev_net(skb_dst(skb)->dev), IPSTATS_MIB_OUTFORWDATAGRAMS); | 46 | IP_INC_STATS_BH(dev_net(skb_dst(skb)->dev), IPSTATS_MIB_OUTFORWDATAGRAMS); |
| 47 | IP_ADD_STATS_BH(dev_net(skb_dst(skb)->dev), IPSTATS_MIB_OUTOCTETS, skb->len); | ||
| 47 | 48 | ||
| 48 | if (unlikely(opt->optlen)) | 49 | if (unlikely(opt->optlen)) |
| 49 | ip_forward_options(skb); | 50 | ip_forward_options(skb); |
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c index a9e519ad6db5..c94bbc6f2ba3 100644 --- a/net/ipv4/ipmr.c +++ b/net/ipv4/ipmr.c | |||
| @@ -1574,6 +1574,7 @@ static inline int ipmr_forward_finish(struct sk_buff *skb) | |||
| 1574 | struct ip_options *opt = &(IPCB(skb)->opt); | 1574 | struct ip_options *opt = &(IPCB(skb)->opt); |
| 1575 | 1575 | ||
| 1576 | IP_INC_STATS_BH(dev_net(skb_dst(skb)->dev), IPSTATS_MIB_OUTFORWDATAGRAMS); | 1576 | IP_INC_STATS_BH(dev_net(skb_dst(skb)->dev), IPSTATS_MIB_OUTFORWDATAGRAMS); |
| 1577 | IP_ADD_STATS_BH(dev_net(skb_dst(skb)->dev), IPSTATS_MIB_OUTOCTETS, skb->len); | ||
| 1577 | 1578 | ||
| 1578 | if (unlikely(opt->optlen)) | 1579 | if (unlikely(opt->optlen)) |
| 1579 | ip_forward_options(skb); | 1580 | ip_forward_options(skb); |
