Skip to contentSkip to conversation

ipt_hashlimit.c, inline patches broken.

PATCH New Samuel Jean 1 participant 1 message Jan 27, 2005 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ipt_hashlimit.c, inline patches broken.

Hi Harald,

Sorry, looks like my mailer puts trailing spaces.
Here's both patch attached.

Regards,

Samuel

ipv4/netfilter/ipt_hashlimit.c renamed from ipv4/netfilter/ipt_hashlimit.c.orig +1 -1
@@ -570,7 +570,7 @@ static void *dl_seq_start(struct seq_fil
 	if (*pos >= htable->cfg.size)
 		return NULL;
 
-	bucket = kmalloc(sizeof(unsigned int), GFP_KERNEL);
+	bucket = kmalloc(sizeof(unsigned int), GFP_ATOMIC);
 	if (!bucket)
 		return ERR_PTR(-ENOMEM);
 
ipv4/netfilter/ipt_hashlimit.c renamed from ipv4/netfilter/ipt_hashlimit.c.orig +2 -2
@@ -608,8 +608,8 @@ static inline int dl_seq_real_show(struc
 	/* recalculate to show accurate numbers */
 	rateinfo_recalc(ent, jiffies);
 
-	return seq_printf(s, "%ld %u.%u.%u.%u:%u->%u.%u.%u.%u:%u %u %u %u\n",
-			(ent->expires - jiffies)/HZ,
+	return seq_printf(s, "%lu %u.%u.%u.%u:%u->%u.%u.%u.%u:%u %u %u %u\n",
+			(ent->expires > jiffies) ? (ent->expires - jiffies)/HZ : 0,
 			NIPQUAD(ent->dst.src_ip), ntohs(ent->dst.src_port),
 			NIPQUAD(ent->dst.dst_ip), ntohs(ent->dst.dst_port),
 			ent->rateinfo.credit, ent->rateinfo.credit_cap,