[Bro-Commits] [git/bro] topic/jsiwek/ipv6-ext-headers: Fix ipv6_ext_headers event and add routing0_data_to_addrs BIF. (5312a90)

I merged from master in a branch I'm working on and the following line is causing trouble…

In file included from /Users/seth/bro/bro.merging/src/Func.cc:531:
bro.bif: In function ‘Val* BifFunc::bro_routing0_data_to_addrs(Frame*, val_list*)’:
bro.bif:2073: error: ‘IPv6’ is not a member of ‘IPAddr’

--- a/src/bro.bif
+++ b/src/bro.bif

<snip>

+function routing0_data_to_addrs%(s: string%): addr_set
+ %{

<snip>

+ IPAddr a(IPAddr::IPv6, (const uint32*) bytes, IPAddr::Network);

  .Seth

I merged from master in a branch I'm working on and the following line is causing trouble…

In file included from /Users/seth/bro/bro.merging/src/Func.cc:531:
bro.bif: In function ‘Val* BifFunc::bro_routing0_data_to_addrs(Frame*, val_list*)’:
bro.bif:2073: error: ‘IPv6’ is not a member of ‘IPAddr’

That's correct for master, but I think I saw Robin may have moved that IP Family enum declaration into the global namespace in one branch (maybe log-threads). In your branch, you can probably try just removing the IPAddr:: scoping.

+Jon

master compiles fine for me. Any chance that might be something
specific to your bracnh?

Robin

I actually tried that already…

/Users/seth/bro/bro.merging/src/IP.cc: In member function ‘RecordVal* IPv6_Hdr::BuildRecordVal(VectorVal*) const’:
/Users/seth/bro/bro.merging/src/IP.cc:77: error: no matching function for call to ‘AddrVal::AddrVal(const in6_addr&)’
/Users/seth/bro/bro.merging/src/Val.h:571: note: candidates are: AddrVal::AddrVal(BroType*)
/Users/seth/bro/bro.merging/src/Val.h:570: note: AddrVal::AddrVal(TypeTag)
/Users/seth/bro/bro.merging/src/Val.h:569: note: AddrVal::AddrVal()
/Users/seth/bro/bro.merging/src/Val.h:563: note: AddrVal::AddrVal(const IPAddr&)
/Users/seth/bro/bro.merging/src/Val.h:562: note: AddrVal::AddrVal(const uint32*)
/Users/seth/bro/bro.merging/src/Val.h:561: note: AddrVal::AddrVal(uint32)
/Users/seth/bro/bro.merging/src/Val.h:555: note: AddrVal::AddrVal(const char*)
/Users/seth/bro/bro.merging/src/Val.h:553: note: AddrVal::AddrVal(const AddrVal&)
/Users/seth/bro/bro.merging/src/IP.cc:78: error: no matching function for call to ‘AddrVal::AddrVal(const in6_addr&)’
/Users/seth/bro/bro.merging/src/Val.h:571: note: candidates are: AddrVal::AddrVal(BroType*)
/Users/seth/bro/bro.merging/src/Val.h:570: note: AddrVal::AddrVal(TypeTag)
/Users/seth/bro/bro.merging/src/Val.h:569: note: AddrVal::AddrVal()
/Users/seth/bro/bro.merging/src/Val.h:563: note: AddrVal::AddrVal(const IPAddr&)
/Users/seth/bro/bro.merging/src/Val.h:562: note: AddrVal::AddrVal(const uint32*)
/Users/seth/bro/bro.merging/src/Val.h:561: note: AddrVal::AddrVal(uint32)
/Users/seth/bro/bro.merging/src/Val.h:555: note: AddrVal::AddrVal(const char*)
/Users/seth/bro/bro.merging/src/Val.h:553: note: AddrVal::AddrVal(const AddrVal&)
/Users/seth/bro/bro.merging/src/IP.cc: In member function ‘void IPv6_Hdr_Chain::Init(const ip6_hdr*, bool, uint16)’:
/Users/seth/bro/bro.merging/src/IP.cc:317: error: no matching function for call to ‘Reporter::Weird(IPAddr&, const in6_addr&, const char [17])’
/Users/seth/bro/bro.merging/src/Reporter.h:75: note: candidates are: void Reporter::Weird(const char*)
/Users/seth/bro/bro.merging/src/Reporter.h:76: note: void Reporter::Weird(Connection*, const char*, const char*)
/Users/seth/bro/bro.merging/src/Reporter.h:77: note: void Reporter::Weird(Val*, const char*, const char*)
/Users/seth/bro/bro.merging/src/Reporter.h:78: note: void Reporter::Weird(const IPAddr&, const IPAddr&, const char*)
make[2]: *** [src/CMakeFiles/bro.dir/IP.cc.o] Error 1
make[1]: *** [src/CMakeFiles/bro.dir/all] Error 2
make: *** [all] Error 2

  .Seth

The same thing happens when I merge master with my input branch. So - it does not seem to be branch-specific.

Johanna

Hm, I guess so. Maybe I have too much merged in. Thanks.

  .Seth

Let me merge master into my logging branch, that might trigger the
same problem and I'll fix it then.

Robin

In your branch, you can probably try just removing the IPAddr:: scoping.

I actually tried that already…

/Users/seth/bro/bro.merging/src/IP.cc: In member function ‘RecordVal* IPv6_Hdr::BuildRecordVal(VectorVal*) const’:
/Users/seth/bro/bro.merging/src/IP.cc:77: error: no matching function for call to ‘AddrVal::AddrVal(const in6_addr&)’
/Users/seth/bro/bro.merging/src/IP.cc:78: error: no matching function for call to ‘AddrVal::AddrVal(const in6_addr&)’
/Users/seth/bro/bro.merging/src/IP.cc: In member function ‘void IPv6_Hdr_Chain::Init(const ip6_hdr*, bool, uint16)’:
/Users/seth/bro/bro.merging/src/IP.cc:317: error: no matching function for call to ‘Reporter::Weird(IPAddr&, const in6_addr&, const char [17])’

Those are because in topic/robin/log-threads, the appropriate IPAddr conversion ctors are marked as 'explicit', but they are not marked as such in master. I'd explicitly add the IPAddr() ctor at those lines to fix it since the implicit conversion might be harder to understand when someone's reading code.

The same thing happens when I merge master with my input branch. So - it does not seem to be branch-specific.

Looks like your branch is probably downstream from Robin's, so it makes sense you get the same thing?

Those are because in topic/robin/log-threads, the appropriate IPAddr
conversion ctors are marked as 'explicit', but they are not marked as
such in master.

Yeah, I believe I was running into some ambiguity without the
explicit.

I've done that and fixed it locally like I mentioned above. Let me
know if it's easier for you if I just push it,

yes, please push. Thanks,

Robin

I think Robin's fixing it in his branch now.

  .Seth

I've done that and fixed it locally like I mentioned above. Let me
know if it's easier for you if I just push it,

yes, please push. Thanks,

Done, others can now try merging that in to their downstream branches.

+Jon

Thanks Jon!

  .Seth