View Issue Details

IDProjectCategoryView StatusLast Update
0003163unrealircdpublic2007-09-05 15:08
ReporterdjGrrr Assigned Tosyzop  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
OS*OS Version* 
Product Version3.2.6 
Fixed in Version3.2.8 
Summary0003163: Allow 1.2.3.4 style IPs in IPv6 mode (not only ::ffff:1.2.3.4) // cgiirc block does not work w/ipv6
DescriptionAs the title says, the cgiirc block does not work when compiled with ipv6 support.
The reason is because when u use the format hostname "1.2.3.4" it gets an error stating that all ips must be in the format ::ffff:1.2.3.4

when you change it to that format, the host simply does not match, making the cgiirc block useless
TagsNo tags attached.
Attached Files
Unreal-3.2.7-ipv6.diff (2,292 bytes)
3rd party modules

Relationships

related to 0003311 resolvedsyzop CGI:IRC & IPv6 Issue 
child of 0003111 closed 3.2.7 Release 
child of 0003454 resolvedsyzop Unreal3.2.8 TODO 

Activities

Bricker

2006-12-25 17:34

reporter   ~0012902

I'll see if I cant test this later

Robby22

2006-12-26 12:47

reporter   ~0012907

Last edited: 2006-12-26 12:49

That's why the IP handling thingie should be rewritten sometime, this also gives problems with OpenBSD and ::ffff:-style addresses on an IPv6-enabled UnrealIRCd, it is hardcoded and the sysctl for that cannot be changed (Operation not permitted), thus making UnrealIRCd useless for listening on IPv4 when it is IPv6-enabled on OpenBSD...

syzop

2006-12-28 10:02

administrator   ~0012930

Last edited: 2007-04-30 12:45

Actually this has little to do with the socket type, Robby22.

We decided a while ago that '1.2.3.4' should be auto converted to '::ffff:1.2.3.4' anyway (and then not reject the '1.2.3.4' form in ipv6 mode).

Perhaps we can use this bugreport for that :P

EDIT: For the record, with auto-converted, we mean that 1.2.3.4 *in the configfile* should be auto-converted to ::ffff:1.2.3.4, this is true for: cgi irc blocks, but also listen blocks, and link blocks, ... and more?

tabrisnet

2007-07-22 12:51

reporter   ~0014547

This appears to still be a problem in 3.2.7.

tabrisnet

2007-07-22 15:22

reporter   ~0014549

Attached a patch, converts IPv4 to IPv6 style addresses. Doesn't actually do anything to CGI::IRC, so isn't complete. This is proof-of-concept.

I may be able to remove the goto and reentrant var, but I was trying to be conservative.

Would greatly appreciate an audit. If it's correct, you should be able to take the link::hostname part and copy it to cgi-irc.

tabrisnet

2007-07-22 15:40

reporter   ~0014550

new patch using MyMalloc and MyFree, per stskeeps

tabrisnet

2007-07-22 17:55

reporter   ~0014551

ok, forgot to upload the v2 patch, but -v3 should do everything that stskeeps suggested, except it still doesn't do anything to cgi-irc

tabrisnet

2007-07-22 19:20

reporter   ~0014554

v4 is near identical to -v3, but includes the cgiirc blocks.

syzop

2007-09-04 05:32

administrator   ~0014751

i'll review this somewhere in the next few weeks, would like this in 3.2.8.

syzop

2007-09-05 15:08

administrator   ~0014753

fixed in .680:
- Now allowing '1.2.3.4' ips again in IPv6 mode as well (instead of enforcing
  '::ffff:1.2.3.4' ips in the conf, they are now auto-converted to that).
  Based on patch from tabrisnet.
- Fixed issue where the cgiirc block did not work with IPv6, reported by
  djGrrr, fixed by previous change.

Just for educational purposes, the diff..
http://cvs.unrealircd.com/cgi/viewcvs.cgi/unreal/src/s_conf.c.diff?r1=1.1.1.1.6.1.2.355.2.84&r2=1.1.1.1.6.1.2.355.2.85&only_with_tag=unreal3_2_fixes
changes re tabrisnet patch:
- no C99 declaration-after-statement
- use stack not heap for temporary storage
- no 'ip' memleak / just don't care about setting 'ip' anyway // merging 2 snprintfs to 1
- inet_pton instead of inet_aton, this is debatable though but I just trust this better (like you set the 2nd arg to NULL, not found in posix, so maybenot crossplatform ok)
that's all, patch was still useful though! ;p

Issue History

Date Modified Username Field Change
2006-12-24 14:55 djGrrr New Issue
2006-12-25 08:24 syzop Product Version 3.2.7 => 3.2.6
2006-12-25 17:34 Bricker Note Added: 0012902
2006-12-26 12:47 Robby22 Note Added: 0012907
2006-12-26 12:49 Robby22 Note Edited: 0012907
2006-12-28 10:02 syzop Note Added: 0012930
2006-12-28 10:02 syzop Status new => acknowledged
2006-12-28 10:02 syzop Summary cgiirc block does not work when compiled with ipv6 => Allow 1.2.3.4 style IPs in IPv6 mode (not only ::ffff:1.2.3.4) // cgiirc block does not work w/ipv6
2007-04-30 10:00 syzop Relationship added related to 0003311
2007-04-30 12:45 syzop Note Edited: 0012930
2007-05-08 13:54 syzop Relationship added child of 0003111
2007-07-22 12:51 tabrisnet Note Added: 0014547
2007-07-22 15:20 tabrisnet File Added: Unreal-3.2.7-ipv6.diff
2007-07-22 15:22 tabrisnet Note Added: 0014549
2007-07-22 15:40 tabrisnet Note Added: 0014550
2007-07-22 17:54 tabrisnet File Added: Unreal-3.2.7-ipv6-v3.diff
2007-07-22 17:55 tabrisnet Note Added: 0014551
2007-07-22 19:20 tabrisnet File Added: Unreal-3.2.7-ipv6-v4.diff
2007-07-22 19:20 tabrisnet Note Added: 0014554
2007-09-04 05:28 syzop Relationship added child of 0003454
2007-09-04 05:32 syzop Note Added: 0014751
2007-09-05 15:08 syzop QA => Not touched yet by developer
2007-09-05 15:08 syzop U4: Need for upstream patch => No need for upstream InspIRCd patch
2007-09-05 15:08 syzop Status acknowledged => resolved
2007-09-05 15:08 syzop Fixed in Version => 3.2.8
2007-09-05 15:08 syzop Resolution open => fixed
2007-09-05 15:08 syzop Assigned To => syzop
2007-09-05 15:08 syzop Note Added: 0014753