confuzed bit flags

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm confused or the source code is or both.

net/ipv6/ndisc.c sets

	rt->rt6i_flags    = RTF_LOCAL;

This is OK AFAIK since RTF_LOCAL is #defined in
./linux/ipv6_route.h:36:#define RTF_LOCAL       0x80000000

But then RTF_LOCAL is never used anywhere else.  OK or not?

Further checking finds that net/ipv6/xfrm6_policy.c does this:

		x->u.rt6.rt6i_flags    = rt0->rt6i_flags&(RTCF_BROADCAST|RTCF_MULTICAST|RTCF_LOCAL);

but these RTCF_ bits are defined in include/linux/in_route.h,
which says:

/* IPv4 routing cache flags */

So it's nice or good that RTF_LOCAL and RTCF_LOCAL are both
#defined as 0x80000000.  Right?

Oh, I see now that there's even a comment that might be applicable
to this <stuff>:
		/* Sheit... I remember I did this right. Apparently,
		 * it was magically lost, so this code needs audit */

I guess that my (idealistic) position is that those RTCF_ bit flags
shouldn't be used here (in net/ipv6) at all.  Am I off track on this?

--
~Randy
-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux