Misuage of hip_hit_t

Bug #648684 reported by Andrius Bentkus
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
HIPL
Confirmed
Low
René Hummen

Bug Description

hip_hit_t is a typedef of in6_addr and it's existence is reasonable!

We can use ip addresses to address the real network and ip addresses to address the network set up by hip and the distinction between them is very clear, apart from the same size of the address holder: hit addresses can't be used on the underlying network and ip address can't be used in the hip network. It helps the coder realize that, for example, the input of a certain function requires a hit address, not an in6_addr.

Now if we take a look at the code, we can see a lot of place where this just doesn't happen, instead of using the typedef, in6_addr is used:
http://bazaar.launchpad.net/~hipl-core/hipl/trunk/annotate/head:/lib/core/hit.h
http://bazaar.launchpad.net/~hipl-core/hipl/trunk/annotate/head:/lib/core/prefix.h#L52
The list goes on and on, a simple command like this: grep "struct in6_addr" -r ./ | grep hit
Will reveal a lot of place where the struct in6_addr is abused.

So if you mean hit, use hip_hit_t!

Revision history for this message
Christof Mroz (christof-mroz) wrote :

LSIs are handled the same way btw (didn't check if their use is incosistent as well though).

Revision history for this message
René Hummen (rene-hummen) wrote :

This should go to the HACKING document. The boy-scout rule applies.

Changed in hipl:
assignee: nobody → René Hummen (rene-hummen)
importance: Undecided → Low
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.