On Mon, Apr 16, 2001 at 08:36:57AM -0600, Wes Peters wrote:
> Looks clean. The only comment I can find is: Why not have ip_randomid()
> return the ID in network byte order? It would save several HTONS macros
> trailing the ip_randomid() calls.
I can't think of anything off the top of my head, but there was some
reason why OpenBSD made this change:
diff -u -r1.12 -r1.13
--- ip_mroute.c 1999/01/08 01:04:17 1.12
+++ ip_mroute.c 1999/01/08 21:51:22 1.13
@@ -1397,7 +1397,8 @@
*/
ip_copy = mtod(mb_copy, struct ip *);
*ip_copy = multicast_encap_iphdr;
- ip_copy->ip_id = htons(ip_randomid());
+ ip_copy->ip_id = ip_randomid();
+ HTONS(ip_copy->ip_id);
ip_copy->ip_len = len;
ip_copy->ip_src = vifp->v_lcl_addr;
ip_copy->ip_dst = vifp->v_rmt_addr;
Presumably there was some reasoning there. Niels, can you shed any
light?
Kris
PGP signature