diff mbox series

ipconfig: Return a unique string for 'CONNMAN_IPCONFIG_TYPE_ALL'.

Message ID 20231128181551.1149522-1-gerickson@nuovations.com (mailing list archive)
State Not Applicable, archived
Headers show
Series ipconfig: Return a unique string for 'CONNMAN_IPCONFIG_TYPE_ALL'. | expand

Commit Message

Grant Erickson Nov. 28, 2023, 6:15 p.m. UTC
At commit 89f70d225df6 ("ipconfig: Define unique value for
CONNMAN_IPCONFIG_TYPE_ALL"), a unique enumertion value was provided
for 'CONNMAN_IPCONFIG_TYPE_ALL' to make it semantically different from
'CONNMAN_IPCONFIG_TYPE_ALL'; however, a unique string returned
from '__connman_ipconfig_type2string' was not, leaving it to misleadingly
return "unknown" for 'CONNMAN_IPCONFIG_TYPE_ALL'.

This addresses this oversight by returning a unique string for
'CONNMAN_IPCONFIG_TYPE_ALL', "IPv4 + IPv6".
---
 src/ipconfig.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Marcel Holtmann Nov. 29, 2023, 12:54 p.m. UTC | #1
Hi Grant,

> At commit 89f70d225df6 ("ipconfig: Define unique value for
> CONNMAN_IPCONFIG_TYPE_ALL"), a unique enumertion value was provided
> for 'CONNMAN_IPCONFIG_TYPE_ALL' to make it semantically different from
> 'CONNMAN_IPCONFIG_TYPE_ALL'; however, a unique string returned
> from '__connman_ipconfig_type2string' was not, leaving it to misleadingly
> return "unknown" for 'CONNMAN_IPCONFIG_TYPE_ALL'.
> 
> This addresses this oversight by returning a unique string for
> 'CONNMAN_IPCONFIG_TYPE_ALL', "IPv4 + IPv6".
> ---
> src/ipconfig.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)

patch has been applied.

Regards

Marcel
diff mbox series

Patch

diff --git a/src/ipconfig.c b/src/ipconfig.c
index 64a74310d450..352ea524dbd9 100644
--- a/src/ipconfig.c
+++ b/src/ipconfig.c
@@ -225,12 +225,13 @@  const char *__connman_ipconfig_type2string(enum connman_ipconfig_type type)
 {
 	switch (type) {
 	case CONNMAN_IPCONFIG_TYPE_UNKNOWN:
-	case CONNMAN_IPCONFIG_TYPE_ALL:
 		return "unknown";
 	case CONNMAN_IPCONFIG_TYPE_IPV4:
 		return "IPv4";
 	case CONNMAN_IPCONFIG_TYPE_IPV6:
 		return "IPv6";
+	case CONNMAN_IPCONFIG_TYPE_ALL:
+		return "IPv4 + IPv6";
 	}
 
 	return NULL;