summaryrefslogtreecommitdiff
path: root/ext/socket/socket.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/socket/socket.c')
-rw-r--r--ext/socket/socket.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/ext/socket/socket.c b/ext/socket/socket.c
index 76cb4ae0454..236356e828c 100644
--- a/ext/socket/socket.c
+++ b/ext/socket/socket.c
@@ -1061,10 +1061,11 @@ ipaddr(struct sockaddr *sockaddr, int norevlookup)
VALUE ary;
int error;
char hbuf[1024], pbuf[1024];
+ ID id;
- family = family_to_str(sockaddr->sa_family);
- if (!NIL_P(family)) {
- family = rb_str_dup(family);
+ id = intern_family(sockaddr->sa_family);
+ if (id) {
+ family = rb_str_dup(rb_id2str(id));
}
else {
sprintf(pbuf, "unknown:%d", sockaddr->sa_family);