summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/lib/substitute.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/source3/lib/substitute.c b/source3/lib/substitute.c
index 59b54c4dff..ce97a36188 100644
--- a/source3/lib/substitute.c
+++ b/source3/lib/substitute.c
@@ -597,10 +597,16 @@ char *alloc_sub_basic(const char *smb_name, const char *domain_name,
}
a_string = realloc_string_sub(a_string, "%D", r);
break;
- case 'I' :
+ case 'I' : {
+ int offset = 0;
+ client_addr(get_client_fd(), addr, sizeof(addr));
+ if (strnequal(addr,"::ffff:",7)) {
+ offset = 7;
+ }
a_string = realloc_string_sub(a_string, "%I",
- client_addr(get_client_fd(),addr, sizeof(addr)));
+ addr + offset);
break;
+ }
case 'i':
a_string = realloc_string_sub( a_string, "%i",
client_socket_addr(get_client_fd(), addr, sizeof(addr)) );