arduino / arduino/ArduinoCore-API

IPAddress toString should use existing printTo algorithm and conform to RFC 5952 canonical format for IPv6 addresses

Abierto
#228 0 comentarios 0 reacciones 0 asignados Ver en GitHub
enhancement
Lenguaje dominante
C++
Estrellas
306
Forks
150
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

### API component

IPAddress

### Description

The `toString()` for an IPv6 type address has a different output from `printTo()`, and does not follow the RFC 5952 canonical format. It has an unnecessarily long fixed length format. Note that IPv4 does not use a fixed length format.

Also note that the existing `printTo()` method already implements the RFC 5952 canonical format algorithm, and has extensive tests (there are no tests for the `toString()` method).

The recommendation would be for `toString()` simply to use the existing algorithm from `printTo()` (and add some unit tests for `toString`).

### Is this a breaking change?

No. Both formats are valid string formats for IPv6, and `fromString()` handles both of them (and all other valid formats), as should any other system. The canonical format is usually shorter, but will not exceed the fixed length format, so there is no issue with overruns.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

Comienza con las implementaciones de IPAddress toString() y printTo(), y después revisa las pruebas existentes de printTo() para los casos de IPv6 canónico de RFC 5952. Haz que toString() use el algoritmo establecido de printTo() y añade pruebas unitarias que cubran su salida; el trabajo estará terminado cuando ambos métodos produzcan el formato canónico esperado.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
cpp
Área
api, networking
Tipo de issue
Error
Dificultad
2/5
Tiempo estimado
1-3 horas
Estado de actividad
Estancado
Claridad
Bien especificado
Aptitud para principiantes
55/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.