| To: | "David S. Miller" <davem@xxxxxxxxxx> |
|---|---|
| Subject: | [PATCH] (4/7) ipmr.c - convert to alloc_netdev |
| From: | Stephen Hemminger <shemminger@xxxxxxxx> |
| Date: | Wed, 25 Jun 2003 11:41:21 -0700 |
| Cc: | netdev@xxxxxxxxxxx |
| Organization: | Open Source Development Lab |
| Sender: | netdev-bounce@xxxxxxxxxxx |
Use time_after to avoid potential for jiffies wrap in timer code.
diff -Nru a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
--- a/net/ipv4/ipmr.c Wed Jun 25 11:30:03 2003
+++ b/net/ipv4/ipmr.c Wed Jun 25 11:30:03 2003
@@ -342,9 +342,8 @@
cp = &mfc_unres_queue;
while ((c=*cp) != NULL) {
- long interval = c->mfc_un.unres.expires - now;
-
- if (interval > 0) {
+ if (time_after(c->mfc_un.unres.expires, now)) {
+ unsigned long interval = c->mfc_un.unres.expires - now;
if (interval < expires)
expires = interval;
cp = &c->next;
@@ -1291,7 +1290,8 @@
large chunk of pimd to kernel. Ough... --ANK
*/
(mroute_do_pim || cache->mfc_un.res.ttls[true_vifi] < 255)
&&
- jiffies - cache->mfc_un.res.last_assert >
MFC_ASSERT_THRESH) {
+ time_after(jiffies,
+ cache->mfc_un.res.last_assert +
MFC_ASSERT_THRESH)) {
cache->mfc_un.res.last_assert = jiffies;
ipmr_cache_report(skb, true_vifi, IGMPMSG_WRONGVIF);
}
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | [PATCH] (3/7) ipmr.c - drop/reacquire in error path., Stephen Hemminger |
|---|---|
| Next by Date: | [PATCH] (5/7) ipmr.c - use alloc_netdev, Stephen Hemminger |
| Previous by Thread: | [PATCH] (3/7) ipmr.c - drop/reacquire in error path., Stephen Hemminger |
| Next by Thread: | [PATCH] (5/7) ipmr.c - use alloc_netdev, Stephen Hemminger |
| Indexes: | [Date] [Thread] [Top] [All Lists] |