From 8235f34903ef1a463127103133c1e93f4842383e Mon Sep 17 00:00:00 2001 From: Michael Poole Date: Mon, 12 Sep 2005 16:11:58 +0000 Subject: [PATCH] Fix previous commit and parsing of ipmasks like 127/8. git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@1480 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- ChangeLog | 6 ++++++ RELEASE.NOTES | 3 ++- ircd/ircd_string.c | 2 +- ircd/m_join.c | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index f25f86b..50694df 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-09-12 Michael Poole + + * RELEASE.NOTES: Note the resolution of ambiguous ipmasks. + + * ircd/ircd_string.c (ipmask_parse): Implement it. + 2005-09-12 Michael Poole * ircd/m_join.c (m_join): If we find an empty key, null out the diff --git a/RELEASE.NOTES b/RELEASE.NOTES index bde760c..199d855 100644 --- a/RELEASE.NOTES +++ b/RELEASE.NOTES @@ -87,7 +87,8 @@ both sides of the net join have the same key. IP masks (as used in bans, G-lines, etc) are now parsed in a more forgiving manner. 127.0.0.0/8, 127.* and 127/8 are all accepted and -mean the same thing. +mean the same thing. Ambiguous expressions like 127/8 are interpreted +as IPv4 masks; to interpret it as an IPv6 mask, use 127:/8. Configuration Changes: diff --git a/ircd/ircd_string.c b/ircd/ircd_string.c index bfdceb5..52caed5 100644 --- a/ircd/ircd_string.c +++ b/ircd/ircd_string.c @@ -628,7 +628,7 @@ ipmask_parse(const char *input, struct irc_in_addr *ip, unsigned char *pbits) ip->in6_16[colon + jj] = 0; } return pos; - } else if (dot) { + } else if (dot || strchr(input, '/')) { unsigned int addr; int len = ircd_aton_ip4(input, &addr, pbits); if (len) { diff --git a/ircd/m_join.c b/ircd/m_join.c index ad41295..f230beb 100644 --- a/ircd/m_join.c +++ b/ircd/m_join.c @@ -132,7 +132,7 @@ int m_join(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) *keys++ = '\0'; /* Empty keys are the same as no keys. */ - if (!key[0]) + if (key && !key[0]) key = 0; clean_channelname(name); -- 2.20.1