aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorJulius Volz <juliusv@google.com>2008-09-02 09:55:53 -0400
committerSimon Horman <horms@verge.net.au>2008-09-04 21:17:12 -0400
commitcfc78c5a09241a3a9561466834996a7fb90c4228 (patch)
tree7377af0f95a7dbfc877d927534c23c7146f3e813 /net/ipv4
parent09571c7ae30865adfa79dccd12a822a65d2c4b5a (diff)
IPVS: Adjust various debug outputs to use new macros
Adjust various debug outputs to use the new *_BUF macro variants for correct output of v4/v6 addresses. Signed-off-by: Julius Volz <juliusv@google.com> Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/ipvs/ip_vs_conn.c57
-rw-r--r--net/ipv4/ipvs/ip_vs_ctl.c24
-rw-r--r--net/ipv4/ipvs/ip_vs_proto_tcp.c45
-rw-r--r--net/ipv4/ipvs/ip_vs_proto_udp.c15
4 files changed, 78 insertions, 63 deletions
diff --git a/net/ipv4/ipvs/ip_vs_conn.c b/net/ipv4/ipvs/ip_vs_conn.c
index e7603d749c09..9a24332fbed8 100644
--- a/net/ipv4/ipvs/ip_vs_conn.c
+++ b/net/ipv4/ipvs/ip_vs_conn.c
@@ -449,16 +449,16 @@ ip_vs_bind_dest(struct ip_vs_conn *cp, struct ip_vs_dest *dest)
449 cp->flags |= atomic_read(&dest->conn_flags); 449 cp->flags |= atomic_read(&dest->conn_flags);
450 cp->dest = dest; 450 cp->dest = dest;
451 451
452 IP_VS_DBG(7, "Bind-dest %s c:%u.%u.%u.%u:%d v:%u.%u.%u.%u:%d " 452 IP_VS_DBG_BUF(7, "Bind-dest %s c:%s:%d v:%s:%d "
453 "d:%u.%u.%u.%u:%d fwd:%c s:%u conn->flags:%X conn->refcnt:%d " 453 "d:%s:%d fwd:%c s:%u conn->flags:%X conn->refcnt:%d "
454 "dest->refcnt:%d\n", 454 "dest->refcnt:%d\n",
455 ip_vs_proto_name(cp->protocol), 455 ip_vs_proto_name(cp->protocol),
456 NIPQUAD(cp->caddr.ip), ntohs(cp->cport), 456 IP_VS_DBG_ADDR(cp->af, &cp->caddr), ntohs(cp->cport),
457 NIPQUAD(cp->vaddr.ip), ntohs(cp->vport), 457 IP_VS_DBG_ADDR(cp->af, &cp->vaddr), ntohs(cp->vport),
458 NIPQUAD(cp->daddr.ip), ntohs(cp->dport), 458 IP_VS_DBG_ADDR(cp->af, &cp->daddr), ntohs(cp->dport),
459 ip_vs_fwd_tag(cp), cp->state, 459 ip_vs_fwd_tag(cp), cp->state,
460 cp->flags, atomic_read(&cp->refcnt), 460 cp->flags, atomic_read(&cp->refcnt),
461 atomic_read(&dest->refcnt)); 461 atomic_read(&dest->refcnt));
462 462
463 /* Update the connection counters */ 463 /* Update the connection counters */
464 if (!(cp->flags & IP_VS_CONN_F_TEMPLATE)) { 464 if (!(cp->flags & IP_VS_CONN_F_TEMPLATE)) {
@@ -512,16 +512,16 @@ static inline void ip_vs_unbind_dest(struct ip_vs_conn *cp)
512 if (!dest) 512 if (!dest)
513 return; 513 return;
514 514
515 IP_VS_DBG(7, "Unbind-dest %s c:%u.%u.%u.%u:%d v:%u.%u.%u.%u:%d " 515 IP_VS_DBG_BUF(7, "Unbind-dest %s c:%s:%d v:%s:%d "
516 "d:%u.%u.%u.%u:%d fwd:%c s:%u conn->flags:%X conn->refcnt:%d " 516 "d:%s:%d fwd:%c s:%u conn->flags:%X conn->refcnt:%d "
517 "dest->refcnt:%d\n", 517 "dest->refcnt:%d\n",
518 ip_vs_proto_name(cp->protocol), 518 ip_vs_proto_name(cp->protocol),
519 NIPQUAD(cp->caddr.ip), ntohs(cp->cport), 519 IP_VS_DBG_ADDR(cp->af, &cp->caddr), ntohs(cp->cport),
520 NIPQUAD(cp->vaddr.ip), ntohs(cp->vport), 520 IP_VS_DBG_ADDR(cp->af, &cp->vaddr), ntohs(cp->vport),
521 NIPQUAD(cp->daddr.ip), ntohs(cp->dport), 521 IP_VS_DBG_ADDR(cp->af, &cp->daddr), ntohs(cp->dport),
522 ip_vs_fwd_tag(cp), cp->state, 522 ip_vs_fwd_tag(cp), cp->state,
523 cp->flags, atomic_read(&cp->refcnt), 523 cp->flags, atomic_read(&cp->refcnt),
524 atomic_read(&dest->refcnt)); 524 atomic_read(&dest->refcnt));
525 525
526 /* Update the connection counters */ 526 /* Update the connection counters */
527 if (!(cp->flags & IP_VS_CONN_F_TEMPLATE)) { 527 if (!(cp->flags & IP_VS_CONN_F_TEMPLATE)) {
@@ -574,13 +574,16 @@ int ip_vs_check_template(struct ip_vs_conn *ct)
574 !(dest->flags & IP_VS_DEST_F_AVAILABLE) || 574 !(dest->flags & IP_VS_DEST_F_AVAILABLE) ||
575 (sysctl_ip_vs_expire_quiescent_template && 575 (sysctl_ip_vs_expire_quiescent_template &&
576 (atomic_read(&dest->weight) == 0))) { 576 (atomic_read(&dest->weight) == 0))) {
577 IP_VS_DBG(9, "check_template: dest not available for " 577 IP_VS_DBG_BUF(9, "check_template: dest not available for "
578 "protocol %s s:%u.%u.%u.%u:%d v:%u.%u.%u.%u:%d " 578 "protocol %s s:%s:%d v:%s:%d "
579 "-> d:%u.%u.%u.%u:%d\n", 579 "-> d:%s:%d\n",
580 ip_vs_proto_name(ct->protocol), 580 ip_vs_proto_name(ct->protocol),
581 NIPQUAD(ct->caddr.ip), ntohs(ct->cport), 581 IP_VS_DBG_ADDR(ct->af, &ct->caddr),
582 NIPQUAD(ct->vaddr.ip), ntohs(ct->vport), 582 ntohs(ct->cport),
583 NIPQUAD(ct->daddr.ip), ntohs(ct->dport)); 583 IP_VS_DBG_ADDR(ct->af, &ct->vaddr),
584 ntohs(ct->vport),
585 IP_VS_DBG_ADDR(ct->af, &ct->daddr),
586 ntohs(ct->dport));
584 587
585 /* 588 /*
586 * Invalidate the connection template 589 * Invalidate the connection template
diff --git a/net/ipv4/ipvs/ip_vs_ctl.c b/net/ipv4/ipvs/ip_vs_ctl.c
index 640203a153c6..6dbc527285fa 100644
--- a/net/ipv4/ipvs/ip_vs_ctl.c
+++ b/net/ipv4/ipvs/ip_vs_ctl.c
@@ -924,13 +924,14 @@ ip_vs_add_dest(struct ip_vs_service *svc, struct ip_vs_dest_user_kern *udest)
924 dest = ip_vs_trash_get_dest(svc, &daddr, dport); 924 dest = ip_vs_trash_get_dest(svc, &daddr, dport);
925 925
926 if (dest != NULL) { 926 if (dest != NULL) {
927 IP_VS_DBG(3, "Get destination %u.%u.%u.%u:%u from trash, " 927 IP_VS_DBG_BUF(3, "Get destination %s:%u from trash, "
928 "dest->refcnt=%d, service %u/%u.%u.%u.%u:%u\n", 928 "dest->refcnt=%d, service %u/%s:%u\n",
929 NIPQUAD(daddr), ntohs(dport), 929 IP_VS_DBG_ADDR(svc->af, &daddr), ntohs(dport),
930 atomic_read(&dest->refcnt), 930 atomic_read(&dest->refcnt),
931 dest->vfwmark, 931 dest->vfwmark,
932 NIPQUAD(dest->vaddr.ip), 932 IP_VS_DBG_ADDR(svc->af, &dest->vaddr),
933 ntohs(dest->vport)); 933 ntohs(dest->vport));
934
934 __ip_vs_update_dest(svc, dest, udest); 935 __ip_vs_update_dest(svc, dest, udest);
935 936
936 /* 937 /*
@@ -1076,10 +1077,11 @@ static void __ip_vs_del_dest(struct ip_vs_dest *dest)
1076 atomic_dec(&dest->svc->refcnt); 1077 atomic_dec(&dest->svc->refcnt);
1077 kfree(dest); 1078 kfree(dest);
1078 } else { 1079 } else {
1079 IP_VS_DBG(3, "Moving dest %u.%u.%u.%u:%u into trash, " 1080 IP_VS_DBG_BUF(3, "Moving dest %s:%u into trash, "
1080 "dest->refcnt=%d\n", 1081 "dest->refcnt=%d\n",
1081 NIPQUAD(dest->addr.ip), ntohs(dest->port), 1082 IP_VS_DBG_ADDR(dest->af, &dest->addr),
1082 atomic_read(&dest->refcnt)); 1083 ntohs(dest->port),
1084 atomic_read(&dest->refcnt));
1083 list_add(&dest->n_list, &ip_vs_dest_trash); 1085 list_add(&dest->n_list, &ip_vs_dest_trash);
1084 atomic_inc(&dest->refcnt); 1086 atomic_inc(&dest->refcnt);
1085 } 1087 }
diff --git a/net/ipv4/ipvs/ip_vs_proto_tcp.c b/net/ipv4/ipvs/ip_vs_proto_tcp.c
index 3da2bb05ee74..de8ed73997c7 100644
--- a/net/ipv4/ipvs/ip_vs_proto_tcp.c
+++ b/net/ipv4/ipvs/ip_vs_proto_tcp.c
@@ -490,19 +490,23 @@ set_tcp_state(struct ip_vs_protocol *pp, struct ip_vs_conn *cp,
490 if (new_state != cp->state) { 490 if (new_state != cp->state) {
491 struct ip_vs_dest *dest = cp->dest; 491 struct ip_vs_dest *dest = cp->dest;
492 492
493 IP_VS_DBG(8, "%s %s [%c%c%c%c] %u.%u.%u.%u:%d->" 493 IP_VS_DBG_BUF(8, "%s %s [%c%c%c%c] %s:%d->"
494 "%u.%u.%u.%u:%d state: %s->%s conn->refcnt:%d\n", 494 "%s:%d state: %s->%s conn->refcnt:%d\n",
495 pp->name, 495 pp->name,
496 (state_off==TCP_DIR_OUTPUT)?"output ":"input ", 496 ((state_off == TCP_DIR_OUTPUT) ?
497 th->syn? 'S' : '.', 497 "output " : "input "),
498 th->fin? 'F' : '.', 498 th->syn ? 'S' : '.',
499 th->ack? 'A' : '.', 499 th->fin ? 'F' : '.',
500 th->rst? 'R' : '.', 500 th->ack ? 'A' : '.',
501 NIPQUAD(cp->daddr.ip), ntohs(cp->dport), 501 th->rst ? 'R' : '.',
502 NIPQUAD(cp->caddr.ip), ntohs(cp->cport), 502 IP_VS_DBG_ADDR(cp->af, &cp->daddr),
503 tcp_state_name(cp->state), 503 ntohs(cp->dport),
504 tcp_state_name(new_state), 504 IP_VS_DBG_ADDR(cp->af, &cp->caddr),
505 atomic_read(&cp->refcnt)); 505 ntohs(cp->cport),
506 tcp_state_name(cp->state),
507 tcp_state_name(new_state),
508 atomic_read(&cp->refcnt));
509
506 if (dest) { 510 if (dest) {
507 if (!(cp->flags & IP_VS_CONN_F_INACTIVE) && 511 if (!(cp->flags & IP_VS_CONN_F_INACTIVE) &&
508 (new_state != IP_VS_TCP_S_ESTABLISHED)) { 512 (new_state != IP_VS_TCP_S_ESTABLISHED)) {
@@ -623,12 +627,15 @@ tcp_app_conn_bind(struct ip_vs_conn *cp)
623 break; 627 break;
624 spin_unlock(&tcp_app_lock); 628 spin_unlock(&tcp_app_lock);
625 629
626 IP_VS_DBG(9, "%s: Binding conn %u.%u.%u.%u:%u->" 630 IP_VS_DBG_BUF(9, "%s: Binding conn %s:%u->"
627 "%u.%u.%u.%u:%u to app %s on port %u\n", 631 "%s:%u to app %s on port %u\n",
628 __func__, 632 __func__,
629 NIPQUAD(cp->caddr.ip), ntohs(cp->cport), 633 IP_VS_DBG_ADDR(cp->af, &cp->caddr),
630 NIPQUAD(cp->vaddr.ip), ntohs(cp->vport), 634 ntohs(cp->cport),
631 inc->name, ntohs(inc->port)); 635 IP_VS_DBG_ADDR(cp->af, &cp->vaddr),
636 ntohs(cp->vport),
637 inc->name, ntohs(inc->port));
638
632 cp->app = inc; 639 cp->app = inc;
633 if (inc->init_conn) 640 if (inc->init_conn)
634 result = inc->init_conn(inc, cp); 641 result = inc->init_conn(inc, cp);
diff --git a/net/ipv4/ipvs/ip_vs_proto_udp.c b/net/ipv4/ipvs/ip_vs_proto_udp.c
index fd8bd934cc02..5f2073e41cf6 100644
--- a/net/ipv4/ipvs/ip_vs_proto_udp.c
+++ b/net/ipv4/ipvs/ip_vs_proto_udp.c
@@ -408,12 +408,15 @@ static int udp_app_conn_bind(struct ip_vs_conn *cp)
408 break; 408 break;
409 spin_unlock(&udp_app_lock); 409 spin_unlock(&udp_app_lock);
410 410
411 IP_VS_DBG(9, "%s: Binding conn %u.%u.%u.%u:%u->" 411 IP_VS_DBG_BUF(9, "%s: Binding conn %s:%u->"
412 "%u.%u.%u.%u:%u to app %s on port %u\n", 412 "%s:%u to app %s on port %u\n",
413 __func__, 413 __func__,
414 NIPQUAD(cp->caddr.ip), ntohs(cp->cport), 414 IP_VS_DBG_ADDR(cp->af, &cp->caddr),
415 NIPQUAD(cp->vaddr.ip), ntohs(cp->vport), 415 ntohs(cp->cport),
416 inc->name, ntohs(inc->port)); 416 IP_VS_DBG_ADDR(cp->af, &cp->vaddr),
417 ntohs(cp->vport),
418 inc->name, ntohs(inc->port));
419
417 cp->app = inc; 420 cp->app = inc;
418 if (inc->init_conn) 421 if (inc->init_conn)
419 result = inc->init_conn(inc, cp); 422 result = inc->init_conn(inc, cp);