Does the ipaddr include a port specification? This will fail miserably with ipv6.
| 64 | // Does the ipaddr include a port specification? |
| 65 | // This will fail miserably with ipv6. |
| 66 | bool includesPort(const char *ipaddr) |
| 67 | { |
| 68 | const char *colon = strrchr(ipaddr,':'); |
| 69 | const char *dot = strrchr(ipaddr,'.'); |
| 70 | return colon && colon > dot; // Works if dot is NULL too. |
| 71 | } |
| 72 | |
| 73 | |
| 74 | // (pat) 5-25: Allow the config neighbor list to optionally include a port. |