arduino / arduino/ArduinoCore-API
IPAddress toString should use existing printTo algorithm and conform to RFC 5952 canonical format for IPv6 addresses
- Langage dominant
- C++
- Étoiles
- 306
- Forks
- 150
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
### 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.
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Piste de recherche
Commencez par les implémentations de IPAddress toString() et printTo(), puis examinez les tests existants de printTo() pour les cas IPv6 canoniques de la RFC 5952. Faites en sorte que toString() utilise l’algorithme printTo() établi et ajoutez des tests unitaires couvrant sa sortie ; le travail est terminé lorsque les deux méthodes produisent le format canonique attendu.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- cpp
- Domaine
- api, networking
- Type d'issue
- Bug
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Activité
- À l'abandon
- Clarté
- Clairement spécifiée
- Accessibilité débutants
- 55/100