diff options
author | Andreas Steffen <andreas.steffen@strongswan.org> | 2008-07-21 19:08:03 +0000 |
---|---|---|
committer | Andreas Steffen <andreas.steffen@strongswan.org> | 2008-07-21 19:08:03 +0000 |
commit | af18c84ffb712fd72670dcdcea0e7a86eb7b890f (patch) | |
tree | 42e5c68d3de143429d501ae591bd9b0dcb6ce071 /src/charon/config/traffic_selector.c | |
parent | ee93541783f938d6fcebe14b08129dff642d2028 (diff) | |
download | strongswan-af18c84ffb712fd72670dcdcea0e7a86eb7b890f.tar.bz2 strongswan-af18c84ffb712fd72670dcdcea0e7a86eb7b890f.tar.xz |
display protoport in dynamic/32 traffic selectors
Diffstat (limited to 'src/charon/config/traffic_selector.c')
-rw-r--r-- | src/charon/config/traffic_selector.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/charon/config/traffic_selector.c b/src/charon/config/traffic_selector.c index 3b706882e..a12e75034 100644 --- a/src/charon/config/traffic_selector.c +++ b/src/charon/config/traffic_selector.c @@ -195,21 +195,22 @@ static int print(FILE *stream, const struct printf_info *info, memeq(this->from, from, this->type == TS_IPV4_ADDR_RANGE ? 4 : 16) && memeq(this->to, to, this->type == TS_IPV4_ADDR_RANGE ? 4 : 16)) { - return fprintf(stream, "dynamic/%d", - this->type == TS_IPV4_ADDR_RANGE ? 32 : 128); - } - - if (this->type == TS_IPV4_ADDR_RANGE) - { - inet_ntop(AF_INET, &this->from4, addr_str, sizeof(addr_str)); + written += fprintf(stream, "dynamic/%d", + this->type == TS_IPV4_ADDR_RANGE ? 32 : 128); } else { - inet_ntop(AF_INET6, &this->from6, addr_str, sizeof(addr_str)); + if (this->type == TS_IPV4_ADDR_RANGE) + { + inet_ntop(AF_INET, &this->from4, addr_str, sizeof(addr_str)); + } + else + { + inet_ntop(AF_INET6, &this->from6, addr_str, sizeof(addr_str)); + } + mask = calc_netbits(this); + written += fprintf(stream, "%s/%d", addr_str, mask); } - mask = calc_netbits(this); - - written += fprintf(stream, "%s/%d", addr_str, mask); /* check if we have protocol and/or port selectors */ has_proto = this->protocol != 0; |