* [GIT PULL 1/2] ipvs: fixed spacing at for statements
2013-08-07 8:40 [GIT PULL 0/2] IPVS enhancement for v3.12 Simon Horman
@ 2013-08-07 8:40 ` Simon Horman
2013-08-07 8:40 ` [GIT PULL 2/2] ipvs: ip_vs_sh: ip_vs_sh_get_port: check skb_header_pointer for NULL Simon Horman
2013-08-07 9:09 ` [GIT PULL 0/2] IPVS enhancement for v3.12 Pablo Neira Ayuso
2 siblings, 0 replies; 4+ messages in thread
From: Simon Horman @ 2013-08-07 8:40 UTC (permalink / raw)
To: Pablo Neira Ayuso
Cc: lvs-devel, netdev, netfilter-devel, Wensong Zhang,
Julian Anastasov, Dragos Foianu, Simon Horman
From: Dragos Foianu <dragos.foianu@gmail.com>
found using checkpatch.pl
Signed-off-by: Dragos Foianu <dragos.foianu@gmail.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
net/netfilter/ipvs/ip_vs_lblcr.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/net/netfilter/ipvs/ip_vs_lblcr.c b/net/netfilter/ipvs/ip_vs_lblcr.c
index 3cd85b2..5199448 100644
--- a/net/netfilter/ipvs/ip_vs_lblcr.c
+++ b/net/netfilter/ipvs/ip_vs_lblcr.c
@@ -414,7 +414,7 @@ static void ip_vs_lblcr_flush(struct ip_vs_service *svc)
spin_lock_bh(&svc->sched_lock);
tbl->dead = 1;
- for (i=0; i<IP_VS_LBLCR_TAB_SIZE; i++) {
+ for (i = 0; i < IP_VS_LBLCR_TAB_SIZE; i++) {
hlist_for_each_entry_safe(en, next, &tbl->bucket[i], list) {
ip_vs_lblcr_free(en);
}
@@ -440,7 +440,7 @@ static inline void ip_vs_lblcr_full_check(struct ip_vs_service *svc)
struct ip_vs_lblcr_entry *en;
struct hlist_node *next;
- for (i=0, j=tbl->rover; i<IP_VS_LBLCR_TAB_SIZE; i++) {
+ for (i = 0, j = tbl->rover; i < IP_VS_LBLCR_TAB_SIZE; i++) {
j = (j + 1) & IP_VS_LBLCR_TAB_MASK;
spin_lock(&svc->sched_lock);
@@ -495,7 +495,7 @@ static void ip_vs_lblcr_check_expire(unsigned long data)
if (goal > tbl->max_size/2)
goal = tbl->max_size/2;
- for (i=0, j=tbl->rover; i<IP_VS_LBLCR_TAB_SIZE; i++) {
+ for (i = 0, j = tbl->rover; i < IP_VS_LBLCR_TAB_SIZE; i++) {
j = (j + 1) & IP_VS_LBLCR_TAB_MASK;
spin_lock(&svc->sched_lock);
@@ -536,7 +536,7 @@ static int ip_vs_lblcr_init_svc(struct ip_vs_service *svc)
/*
* Initialize the hash buckets
*/
- for (i=0; i<IP_VS_LBLCR_TAB_SIZE; i++) {
+ for (i = 0; i < IP_VS_LBLCR_TAB_SIZE; i++) {
INIT_HLIST_HEAD(&tbl->bucket[i]);
}
tbl->max_size = IP_VS_LBLCR_TAB_SIZE*16;
--
1.8.3.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [GIT PULL 2/2] ipvs: ip_vs_sh: ip_vs_sh_get_port: check skb_header_pointer for NULL
2013-08-07 8:40 [GIT PULL 0/2] IPVS enhancement for v3.12 Simon Horman
2013-08-07 8:40 ` [GIT PULL 1/2] ipvs: fixed spacing at for statements Simon Horman
@ 2013-08-07 8:40 ` Simon Horman
2013-08-07 9:09 ` [GIT PULL 0/2] IPVS enhancement for v3.12 Pablo Neira Ayuso
2 siblings, 0 replies; 4+ messages in thread
From: Simon Horman @ 2013-08-07 8:40 UTC (permalink / raw)
To: Pablo Neira Ayuso
Cc: lvs-devel, netdev, netfilter-devel, Wensong Zhang,
Julian Anastasov, Daniel Borkmann, Simon Horman
From: Daniel Borkmann <dborkman@redhat.com>
skb_header_pointer could return NULL, so check for it as we do it
everywhere else in ipvs code. This fixes a coverity warning.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Acked-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
net/netfilter/ipvs/ip_vs_sh.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/net/netfilter/ipvs/ip_vs_sh.c b/net/netfilter/ipvs/ip_vs_sh.c
index f16c027..3588fae 100644
--- a/net/netfilter/ipvs/ip_vs_sh.c
+++ b/net/netfilter/ipvs/ip_vs_sh.c
@@ -269,14 +269,20 @@ ip_vs_sh_get_port(const struct sk_buff *skb, struct ip_vs_iphdr *iph)
switch (iph->protocol) {
case IPPROTO_TCP:
th = skb_header_pointer(skb, iph->len, sizeof(_tcph), &_tcph);
+ if (unlikely(th == NULL))
+ return 0;
port = th->source;
break;
case IPPROTO_UDP:
uh = skb_header_pointer(skb, iph->len, sizeof(_udph), &_udph);
+ if (unlikely(uh == NULL))
+ return 0;
port = uh->source;
break;
case IPPROTO_SCTP:
sh = skb_header_pointer(skb, iph->len, sizeof(_sctph), &_sctph);
+ if (unlikely(sh == NULL))
+ return 0;
port = sh->source;
break;
default:
--
1.8.3.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [GIT PULL 0/2] IPVS enhancement for v3.12
2013-08-07 8:40 [GIT PULL 0/2] IPVS enhancement for v3.12 Simon Horman
2013-08-07 8:40 ` [GIT PULL 1/2] ipvs: fixed spacing at for statements Simon Horman
2013-08-07 8:40 ` [GIT PULL 2/2] ipvs: ip_vs_sh: ip_vs_sh_get_port: check skb_header_pointer for NULL Simon Horman
@ 2013-08-07 9:09 ` Pablo Neira Ayuso
2 siblings, 0 replies; 4+ messages in thread
From: Pablo Neira Ayuso @ 2013-08-07 9:09 UTC (permalink / raw)
To: Simon Horman
Cc: lvs-devel, netdev, netfilter-devel, Wensong Zhang,
Julian Anastasov
On Wed, Aug 07, 2013 at 05:40:27PM +0900, Simon Horman wrote:
> Hi Pablo,
>
> please consider the following IPVS enhancement for v3.12.
>
> It looks like v3.12 is going to be pretty quiet for IPVS
> as at this stage I'm not expecting anything more than a few more cleanup
> patches. And I'm not even sure if they will come through.
I see, thanks for the information Simon. Pulled these two patches.
^ permalink raw reply [flat|nested] 4+ messages in thread