Kernel Network Subsystem Patching
Aruna Hewapathirane
aruna.hewapathirane at gmail.com
Fri Jan 10 19:52:43 EST 2014
Hi,
I am a newbie to kernel hacking and I have a question. Am trying to patch
the Network Subsystem and changing the net_random() to direct calls of
prandom_u32. Why ? Because it is
harder to audit / grep and new commits actually use prandom_u32 only am
told.
u32 prandom_u32(void); /* defined in include/linux/random.h: */
#define net_random() prandom_u32() /* defined in include/linux/net.h
*/
Everything works as expected until I get to net/core/neighbour.c and then
patch fails to apply.
The diff is here:
-------------------------------------------------------------------------------------------------------------------------------
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 47d834e..ea97361 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -117,7 +117,7 @@ static void neigh_cleanup_and_release(struct neighbour
*neig
unsigned long neigh_rand_reach_time(unsigned long base)
{
- return base ? (prandom_u32() % base) + (base >> 1) : 0;
+ return base ? (net_random() % base) + (base >> 1) : 0;
}
EXPORT_SYMBOL(neigh_rand_reach_time);
@@ -1415,7 +1415,7 @@ void pneigh_enqueue(struct neigh_table *tbl, struct
neigh_
struct sk_buff *skb)
{
unsigned long now = jiffies;
- unsigned long sched_next = now + (prandom_u32() %
+ unsigned long sched_next = now + (net_random() %
NEIGH_VAR(p, PROXY_DELAY));
if (tbl->proxy_queue.qlen > NEIGH_VAR(p, PROXY_QLEN)) {
-------------------------------------------------------------------------------------------------------------------------------
I can use some help and guidance please, what am I doing wrong ? Or not
seeing ? It's just this neighbor.c file that is doing this and I am
stumped.
Thank you.
Aruna Hewapathirane
<https://sites.google.com/site/arunahewapathirane/home/business-card/buisness-card.png?attredirects=0>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140110/2c9d9128/attachment-0001.html
More information about the Kernelnewbies
mailing list