<div dir="ltr"><div><div>Hello Everybody,<br></div><div><br></div>I am a total 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<br>
harder to audit / <span>grep</span> and new commits actually use prandom_u32 only am told.<br><br></div><div>u32 prandom_u32(void);    /* defined in include/linux/random.h: */<br><br></div><div>#define net_random()        prandom_u32() /* defined in include/linux/net.h */<br>

<br></div><div>Everything works as expected until I get to net/core/neighbour.c and then patch fails to apply.<br></div><div><br></div>The diff is here: <br><div><br>-------------------------------------------------------------------------------------------------------------------------------<br>


diff --git a/net/core/neighbour.c b/net/core/neighbour.c<br>index 47d834e..ea97361 100644<br>--- a/net/core/neighbour.c<br>+++ b/net/core/neighbour.c<br>@@ -117,7 +117,7 @@ static void neigh_cleanup_and_release(struct neighbour *neig<br>

 <br> unsigned long neigh_rand_reach_time(unsigned long base)<br> {<br>-       return base ? (prandom_u32() % base) + (base >> 1) : 0;<br>+       return base ? (net_random() % base) + (base >> 1) : 0;<br> }<br>

 EXPORT_SYMBOL(neigh_rand_reach_time);<br> <br>@@ -1415,7 +1415,7 @@ void pneigh_enqueue(struct neigh_table *tbl, struct neigh_<br>                    struct sk_buff *skb)<br> {<br>        unsigned long now = jiffies;<br>

-       unsigned long sched_next = now + (prandom_u32() %<br>+       unsigned long sched_next = now + (net_random() %<br>                                          NEIGH_VAR(p, PROXY_DELAY));<br> <br>        if (tbl->proxy_queue.qlen > NEIGH_VAR(p, PROXY_QLEN)) {<br>

-------------------------------------------------------------------------------------------------------------------------------<br>
<br></div><div>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. <br><br></div>Thank you.<div class=""><div id=":3ie" class="" tabindex="0"><img class="" src="https://mail.google.com/mail/u/0/images/cleardot.gif"></div></div>Aruna<br clear="all"><div><a href="https://sites.google.com/site/arunahewapathirane/home/business-card/buisness-card.png?attredirects=0" target="_blank"><br>
</a>
</div></div>