aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulian Anastasov <ja@ssi.bg>2010-10-17 09:46:17 -0400
committerSimon Horman <horms@verge.net.au>2010-10-21 05:04:43 -0400
commit0d79641a96d612aaa6d57a4d4f521d7ed9c9ccdd (patch)
tree9783497ace4f8ff8eeac24524ecb93012166c60d
parent3233759be7eeca9998c514b8f49e8cf2b85e64d3 (diff)
ipvs: provide address family for debugging
As skb->protocol is not valid in LOCAL_OUT add parameter for address family in packet debugging functions. Even if ports are not present in AH and ESP change them to use ip_vs_tcpudp_debug_packet to show at least valid addresses as before. This patch removes the last user of skb->protocol in IPVS. Signed-off-by: Julian Anastasov <ja@ssi.bg> Signed-off-by: Simon Horman <horms@verge.net.au>
-rw-r--r--include/net/ip_vs.h17
-rw-r--r--net/netfilter/ipvs/ip_vs_core.c41
-rw-r--r--net/netfilter/ipvs/ip_vs_proto.c8
-rw-r--r--net/netfilter/ipvs/ip_vs_proto_ah_esp.c52
-rw-r--r--net/netfilter/ipvs/ip_vs_proto_sctp.c2
-rw-r--r--net/netfilter/ipvs/ip_vs_proto_tcp.c4
-rw-r--r--net/netfilter/ipvs/ip_vs_proto_udp.c4
-rw-r--r--net/netfilter/ipvs/ip_vs_xmit.c18
8 files changed, 54 insertions, 92 deletions
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index 2f88d5942332..b7bbd6c28cfa 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -136,24 +136,24 @@ static inline const char *ip_vs_dbg_addr(int af, char *buf, size_t buf_len,
136 if (net_ratelimit()) \ 136 if (net_ratelimit()) \
137 printk(KERN_DEBUG pr_fmt(msg), ##__VA_ARGS__); \ 137 printk(KERN_DEBUG pr_fmt(msg), ##__VA_ARGS__); \
138 } while (0) 138 } while (0)
139#define IP_VS_DBG_PKT(level, pp, skb, ofs, msg) \ 139#define IP_VS_DBG_PKT(level, af, pp, skb, ofs, msg) \
140 do { \ 140 do { \
141 if (level <= ip_vs_get_debug_level()) \ 141 if (level <= ip_vs_get_debug_level()) \
142 pp->debug_packet(pp, skb, ofs, msg); \ 142 pp->debug_packet(af, pp, skb, ofs, msg); \
143 } while (0) 143 } while (0)
144#define IP_VS_DBG_RL_PKT(level, pp, skb, ofs, msg) \ 144#define IP_VS_DBG_RL_PKT(level, af, pp, skb, ofs, msg) \
145 do { \ 145 do { \
146 if (level <= ip_vs_get_debug_level() && \ 146 if (level <= ip_vs_get_debug_level() && \
147 net_ratelimit()) \ 147 net_ratelimit()) \
148 pp->debug_packet(pp, skb, ofs, msg); \ 148 pp->debug_packet(af, pp, skb, ofs, msg); \
149 } while (0) 149 } while (0)
150#else /* NO DEBUGGING at ALL */ 150#else /* NO DEBUGGING at ALL */
151#define IP_VS_DBG_BUF(level, msg...) do {} while (0) 151#define IP_VS_DBG_BUF(level, msg...) do {} while (0)
152#define IP_VS_ERR_BUF(msg...) do {} while (0) 152#define IP_VS_ERR_BUF(msg...) do {} while (0)
153#define IP_VS_DBG(level, msg...) do {} while (0) 153#define IP_VS_DBG(level, msg...) do {} while (0)
154#define IP_VS_DBG_RL(msg...) do {} while (0) 154#define IP_VS_DBG_RL(msg...) do {} while (0)
155#define IP_VS_DBG_PKT(level, pp, skb, ofs, msg) do {} while (0) 155#define IP_VS_DBG_PKT(level, af, pp, skb, ofs, msg) do {} while (0)
156#define IP_VS_DBG_RL_PKT(level, pp, skb, ofs, msg) do {} while (0) 156#define IP_VS_DBG_RL_PKT(level, af, pp, skb, ofs, msg) do {} while (0)
157#endif 157#endif
158 158
159#define IP_VS_BUG() BUG() 159#define IP_VS_BUG() BUG()
@@ -345,7 +345,7 @@ struct ip_vs_protocol {
345 345
346 int (*app_conn_bind)(struct ip_vs_conn *cp); 346 int (*app_conn_bind)(struct ip_vs_conn *cp);
347 347
348 void (*debug_packet)(struct ip_vs_protocol *pp, 348 void (*debug_packet)(int af, struct ip_vs_protocol *pp,
349 const struct sk_buff *skb, 349 const struct sk_buff *skb,
350 int offset, 350 int offset,
351 const char *msg); 351 const char *msg);
@@ -828,7 +828,8 @@ extern int
828ip_vs_set_state_timeout(int *table, int num, const char *const *names, 828ip_vs_set_state_timeout(int *table, int num, const char *const *names,
829 const char *name, int to); 829 const char *name, int to);
830extern void 830extern void
831ip_vs_tcpudp_debug_packet(struct ip_vs_protocol *pp, const struct sk_buff *skb, 831ip_vs_tcpudp_debug_packet(int af, struct ip_vs_protocol *pp,
832 const struct sk_buff *skb,
832 int offset, const char *msg); 833 int offset, const char *msg);
833 834
834extern struct ip_vs_protocol ip_vs_protocol_tcp; 835extern struct ip_vs_protocol ip_vs_protocol_tcp;
diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c
index 5fbcf67af8ec..b4e51e9c5a04 100644
--- a/net/netfilter/ipvs/ip_vs_core.c
+++ b/net/netfilter/ipvs/ip_vs_core.c
@@ -365,7 +365,8 @@ ip_vs_schedule(struct ip_vs_service *svc, struct sk_buff *skb,
365 * with persistence the connection is created on SYN+ACK. 365 * with persistence the connection is created on SYN+ACK.
366 */ 366 */
367 if (pptr[0] == FTPDATA) { 367 if (pptr[0] == FTPDATA) {
368 IP_VS_DBG_PKT(12, pp, skb, 0, "Not scheduling FTPDATA"); 368 IP_VS_DBG_PKT(12, svc->af, pp, skb, 0,
369 "Not scheduling FTPDATA");
369 return NULL; 370 return NULL;
370 } 371 }
371 372
@@ -376,7 +377,7 @@ ip_vs_schedule(struct ip_vs_service *svc, struct sk_buff *skb,
376 if ((!skb->dev || skb->dev->flags & IFF_LOOPBACK) && 377 if ((!skb->dev || skb->dev->flags & IFF_LOOPBACK) &&
377 (svc->flags & IP_VS_SVC_F_PERSISTENT || svc->fwmark) && 378 (svc->flags & IP_VS_SVC_F_PERSISTENT || svc->fwmark) &&
378 (cp = pp->conn_in_get(svc->af, skb, pp, &iph, iph.len, 1))) { 379 (cp = pp->conn_in_get(svc->af, skb, pp, &iph, iph.len, 1))) {
379 IP_VS_DBG_PKT(12, pp, skb, 0, 380 IP_VS_DBG_PKT(12, svc->af, pp, skb, 0,
380 "Not scheduling reply for existing connection"); 381 "Not scheduling reply for existing connection");
381 __ip_vs_conn_put(cp); 382 __ip_vs_conn_put(cp);
382 return NULL; 383 return NULL;
@@ -617,10 +618,10 @@ void ip_vs_nat_icmp(struct sk_buff *skb, struct ip_vs_protocol *pp,
617 skb->ip_summed = CHECKSUM_UNNECESSARY; 618 skb->ip_summed = CHECKSUM_UNNECESSARY;
618 619
619 if (inout) 620 if (inout)
620 IP_VS_DBG_PKT(11, pp, skb, (void *)ciph - (void *)iph, 621 IP_VS_DBG_PKT(11, AF_INET, pp, skb, (void *)ciph - (void *)iph,
621 "Forwarding altered outgoing ICMP"); 622 "Forwarding altered outgoing ICMP");
622 else 623 else
623 IP_VS_DBG_PKT(11, pp, skb, (void *)ciph - (void *)iph, 624 IP_VS_DBG_PKT(11, AF_INET, pp, skb, (void *)ciph - (void *)iph,
624 "Forwarding altered incoming ICMP"); 625 "Forwarding altered incoming ICMP");
625} 626}
626 627
@@ -662,11 +663,13 @@ void ip_vs_nat_icmp_v6(struct sk_buff *skb, struct ip_vs_protocol *pp,
662 skb->ip_summed = CHECKSUM_PARTIAL; 663 skb->ip_summed = CHECKSUM_PARTIAL;
663 664
664 if (inout) 665 if (inout)
665 IP_VS_DBG_PKT(11, pp, skb, (void *)ciph - (void *)iph, 666 IP_VS_DBG_PKT(11, AF_INET6, pp, skb,
666 "Forwarding altered outgoing ICMPv6"); 667 (void *)ciph - (void *)iph,
668 "Forwarding altered outgoing ICMPv6");
667 else 669 else
668 IP_VS_DBG_PKT(11, pp, skb, (void *)ciph - (void *)iph, 670 IP_VS_DBG_PKT(11, AF_INET6, pp, skb,
669 "Forwarding altered incoming ICMPv6"); 671 (void *)ciph - (void *)iph,
672 "Forwarding altered incoming ICMPv6");
670} 673}
671#endif 674#endif
672 675
@@ -798,7 +801,8 @@ static int ip_vs_out_icmp(struct sk_buff *skb, int *related,
798 pp->dont_defrag)) 801 pp->dont_defrag))
799 return NF_ACCEPT; 802 return NF_ACCEPT;
800 803
801 IP_VS_DBG_PKT(11, pp, skb, offset, "Checking outgoing ICMP for"); 804 IP_VS_DBG_PKT(11, AF_INET, pp, skb, offset,
805 "Checking outgoing ICMP for");
802 806
803 offset += cih->ihl * 4; 807 offset += cih->ihl * 4;
804 808
@@ -874,7 +878,8 @@ static int ip_vs_out_icmp_v6(struct sk_buff *skb, int *related,
874 if (unlikely(cih->nexthdr == IPPROTO_FRAGMENT && pp->dont_defrag)) 878 if (unlikely(cih->nexthdr == IPPROTO_FRAGMENT && pp->dont_defrag))
875 return NF_ACCEPT; 879 return NF_ACCEPT;
876 880
877 IP_VS_DBG_PKT(11, pp, skb, offset, "Checking outgoing ICMPv6 for"); 881 IP_VS_DBG_PKT(11, AF_INET6, pp, skb, offset,
882 "Checking outgoing ICMPv6 for");
878 883
879 offset += sizeof(struct ipv6hdr); 884 offset += sizeof(struct ipv6hdr);
880 885
@@ -922,7 +927,7 @@ static unsigned int
922handle_response(int af, struct sk_buff *skb, struct ip_vs_protocol *pp, 927handle_response(int af, struct sk_buff *skb, struct ip_vs_protocol *pp,
923 struct ip_vs_conn *cp, int ihl) 928 struct ip_vs_conn *cp, int ihl)
924{ 929{
925 IP_VS_DBG_PKT(11, pp, skb, 0, "Outgoing packet"); 930 IP_VS_DBG_PKT(11, af, pp, skb, 0, "Outgoing packet");
926 931
927 if (!skb_make_writable(skb, ihl)) 932 if (!skb_make_writable(skb, ihl))
928 goto drop; 933 goto drop;
@@ -967,7 +972,7 @@ handle_response(int af, struct sk_buff *skb, struct ip_vs_protocol *pp,
967 ip_route_me_harder(skb, RTN_LOCAL) != 0) 972 ip_route_me_harder(skb, RTN_LOCAL) != 0)
968 goto drop; 973 goto drop;
969 974
970 IP_VS_DBG_PKT(10, pp, skb, 0, "After SNAT"); 975 IP_VS_DBG_PKT(10, af, pp, skb, 0, "After SNAT");
971 976
972 ip_vs_out_stats(cp, skb); 977 ip_vs_out_stats(cp, skb);
973 ip_vs_set_state(cp, IP_VS_DIR_OUTPUT, skb, pp); 978 ip_vs_set_state(cp, IP_VS_DIR_OUTPUT, skb, pp);
@@ -1117,7 +1122,7 @@ ip_vs_out(unsigned int hooknum, struct sk_buff *skb, int af)
1117 } 1122 }
1118 } 1123 }
1119 } 1124 }
1120 IP_VS_DBG_PKT(12, pp, skb, 0, 1125 IP_VS_DBG_PKT(12, af, pp, skb, 0,
1121 "ip_vs_out: packet continues traversal as normal"); 1126 "ip_vs_out: packet continues traversal as normal");
1122 return NF_ACCEPT; 1127 return NF_ACCEPT;
1123} 1128}
@@ -1253,7 +1258,8 @@ ip_vs_in_icmp(struct sk_buff *skb, int *related, unsigned int hooknum)
1253 pp->dont_defrag)) 1258 pp->dont_defrag))
1254 return NF_ACCEPT; 1259 return NF_ACCEPT;
1255 1260
1256 IP_VS_DBG_PKT(11, pp, skb, offset, "Checking incoming ICMP for"); 1261 IP_VS_DBG_PKT(11, AF_INET, pp, skb, offset,
1262 "Checking incoming ICMP for");
1257 1263
1258 offset += cih->ihl * 4; 1264 offset += cih->ihl * 4;
1259 1265
@@ -1364,7 +1370,8 @@ ip_vs_in_icmp_v6(struct sk_buff *skb, int *related, unsigned int hooknum)
1364 if (unlikely(cih->nexthdr == IPPROTO_FRAGMENT && pp->dont_defrag)) 1370 if (unlikely(cih->nexthdr == IPPROTO_FRAGMENT && pp->dont_defrag))
1365 return NF_ACCEPT; 1371 return NF_ACCEPT;
1366 1372
1367 IP_VS_DBG_PKT(11, pp, skb, offset, "Checking incoming ICMPv6 for"); 1373 IP_VS_DBG_PKT(11, AF_INET6, pp, skb, offset,
1374 "Checking incoming ICMPv6 for");
1368 1375
1369 offset += sizeof(struct ipv6hdr); 1376 offset += sizeof(struct ipv6hdr);
1370 1377
@@ -1492,12 +1499,12 @@ ip_vs_in(unsigned int hooknum, struct sk_buff *skb, int af)
1492 1499
1493 if (unlikely(!cp)) { 1500 if (unlikely(!cp)) {
1494 /* sorry, all this trouble for a no-hit :) */ 1501 /* sorry, all this trouble for a no-hit :) */
1495 IP_VS_DBG_PKT(12, pp, skb, 0, 1502 IP_VS_DBG_PKT(12, af, pp, skb, 0,
1496 "ip_vs_in: packet continues traversal as normal"); 1503 "ip_vs_in: packet continues traversal as normal");
1497 return NF_ACCEPT; 1504 return NF_ACCEPT;
1498 } 1505 }
1499 1506
1500 IP_VS_DBG_PKT(11, pp, skb, 0, "Incoming packet"); 1507 IP_VS_DBG_PKT(11, af, pp, skb, 0, "Incoming packet");
1501 1508
1502 /* Check the server status */ 1509 /* Check the server status */
1503 if (cp->dest && !(cp->dest->flags & IP_VS_DEST_F_AVAILABLE)) { 1510 if (cp->dest && !(cp->dest->flags & IP_VS_DEST_F_AVAILABLE)) {
diff --git a/net/netfilter/ipvs/ip_vs_proto.c b/net/netfilter/ipvs/ip_vs_proto.c
index 027f654799fe..c53998390877 100644
--- a/net/netfilter/ipvs/ip_vs_proto.c
+++ b/net/netfilter/ipvs/ip_vs_proto.c
@@ -172,8 +172,8 @@ ip_vs_tcpudp_debug_packet_v4(struct ip_vs_protocol *pp,
172 else if (ih->frag_off & htons(IP_OFFSET)) 172 else if (ih->frag_off & htons(IP_OFFSET))
173 sprintf(buf, "%pI4->%pI4 frag", &ih->saddr, &ih->daddr); 173 sprintf(buf, "%pI4->%pI4 frag", &ih->saddr, &ih->daddr);
174 else { 174 else {
175 __be16 _ports[2], *pptr 175 __be16 _ports[2], *pptr;
176; 176
177 pptr = skb_header_pointer(skb, offset + ih->ihl*4, 177 pptr = skb_header_pointer(skb, offset + ih->ihl*4,
178 sizeof(_ports), _ports); 178 sizeof(_ports), _ports);
179 if (pptr == NULL) 179 if (pptr == NULL)
@@ -223,13 +223,13 @@ ip_vs_tcpudp_debug_packet_v6(struct ip_vs_protocol *pp,
223 223
224 224
225void 225void
226ip_vs_tcpudp_debug_packet(struct ip_vs_protocol *pp, 226ip_vs_tcpudp_debug_packet(int af, struct ip_vs_protocol *pp,
227 const struct sk_buff *skb, 227 const struct sk_buff *skb,
228 int offset, 228 int offset,
229 const char *msg) 229 const char *msg)
230{ 230{
231#ifdef CONFIG_IP_VS_IPV6 231#ifdef CONFIG_IP_VS_IPV6
232 if (skb->protocol == htons(ETH_P_IPV6)) 232 if (af == AF_INET6)
233 ip_vs_tcpudp_debug_packet_v6(pp, skb, offset, msg); 233 ip_vs_tcpudp_debug_packet_v6(pp, skb, offset, msg);
234 else 234 else
235#endif 235#endif
diff --git a/net/netfilter/ipvs/ip_vs_proto_ah_esp.c b/net/netfilter/ipvs/ip_vs_proto_ah_esp.c
index 8956ef33ea6c..3a0461117d3f 100644
--- a/net/netfilter/ipvs/ip_vs_proto_ah_esp.c
+++ b/net/netfilter/ipvs/ip_vs_proto_ah_esp.c
@@ -117,54 +117,6 @@ ah_esp_conn_schedule(int af, struct sk_buff *skb, struct ip_vs_protocol *pp,
117 return 0; 117 return 0;
118} 118}
119 119
120
121static void
122ah_esp_debug_packet_v4(struct ip_vs_protocol *pp, const struct sk_buff *skb,
123 int offset, const char *msg)
124{
125 char buf[256];
126 struct iphdr _iph, *ih;
127
128 ih = skb_header_pointer(skb, offset, sizeof(_iph), &_iph);
129 if (ih == NULL)
130 sprintf(buf, "TRUNCATED");
131 else
132 sprintf(buf, "%pI4->%pI4", &ih->saddr, &ih->daddr);
133
134 pr_debug("%s: %s %s\n", msg, pp->name, buf);
135}
136
137#ifdef CONFIG_IP_VS_IPV6
138static void
139ah_esp_debug_packet_v6(struct ip_vs_protocol *pp, const struct sk_buff *skb,
140 int offset, const char *msg)
141{
142 char buf[256];
143 struct ipv6hdr _iph, *ih;
144
145 ih = skb_header_pointer(skb, offset, sizeof(_iph), &_iph);
146 if (ih == NULL)
147 sprintf(buf, "TRUNCATED");
148 else
149 sprintf(buf, "%pI6->%pI6", &ih->saddr, &ih->daddr);
150
151 pr_debug("%s: %s %s\n", msg, pp->name, buf);
152}
153#endif
154
155static void
156ah_esp_debug_packet(struct ip_vs_protocol *pp, const struct sk_buff *skb,
157 int offset, const char *msg)
158{
159#ifdef CONFIG_IP_VS_IPV6
160 if (skb->protocol == htons(ETH_P_IPV6))
161 ah_esp_debug_packet_v6(pp, skb, offset, msg);
162 else
163#endif
164 ah_esp_debug_packet_v4(pp, skb, offset, msg);
165}
166
167
168static void ah_esp_init(struct ip_vs_protocol *pp) 120static void ah_esp_init(struct ip_vs_protocol *pp)
169{ 121{
170 /* nothing to do now */ 122 /* nothing to do now */
@@ -195,7 +147,7 @@ struct ip_vs_protocol ip_vs_protocol_ah = {
195 .register_app = NULL, 147 .register_app = NULL,
196 .unregister_app = NULL, 148 .unregister_app = NULL,
197 .app_conn_bind = NULL, 149 .app_conn_bind = NULL,
198 .debug_packet = ah_esp_debug_packet, 150 .debug_packet = ip_vs_tcpudp_debug_packet,
199 .timeout_change = NULL, /* ISAKMP */ 151 .timeout_change = NULL, /* ISAKMP */
200 .set_state_timeout = NULL, 152 .set_state_timeout = NULL,
201}; 153};
@@ -219,7 +171,7 @@ struct ip_vs_protocol ip_vs_protocol_esp = {
219 .register_app = NULL, 171 .register_app = NULL,
220 .unregister_app = NULL, 172 .unregister_app = NULL,
221 .app_conn_bind = NULL, 173 .app_conn_bind = NULL,
222 .debug_packet = ah_esp_debug_packet, 174 .debug_packet = ip_vs_tcpudp_debug_packet,
223 .timeout_change = NULL, /* ISAKMP */ 175 .timeout_change = NULL, /* ISAKMP */
224}; 176};
225#endif 177#endif
diff --git a/net/netfilter/ipvs/ip_vs_proto_sctp.c b/net/netfilter/ipvs/ip_vs_proto_sctp.c
index 9ab5232ce019..d254345bfda7 100644
--- a/net/netfilter/ipvs/ip_vs_proto_sctp.c
+++ b/net/netfilter/ipvs/ip_vs_proto_sctp.c
@@ -176,7 +176,7 @@ sctp_csum_check(int af, struct sk_buff *skb, struct ip_vs_protocol *pp)
176 176
177 if (val != cmp) { 177 if (val != cmp) {
178 /* CRC failure, dump it. */ 178 /* CRC failure, dump it. */
179 IP_VS_DBG_RL_PKT(0, pp, skb, 0, 179 IP_VS_DBG_RL_PKT(0, af, pp, skb, 0,
180 "Failed checksum for"); 180 "Failed checksum for");
181 return 0; 181 return 0;
182 } 182 }
diff --git a/net/netfilter/ipvs/ip_vs_proto_tcp.c b/net/netfilter/ipvs/ip_vs_proto_tcp.c
index 85d80a66b492..f6c5200e2146 100644
--- a/net/netfilter/ipvs/ip_vs_proto_tcp.c
+++ b/net/netfilter/ipvs/ip_vs_proto_tcp.c
@@ -300,7 +300,7 @@ tcp_csum_check(int af, struct sk_buff *skb, struct ip_vs_protocol *pp)
300 skb->len - tcphoff, 300 skb->len - tcphoff,
301 ipv6_hdr(skb)->nexthdr, 301 ipv6_hdr(skb)->nexthdr,
302 skb->csum)) { 302 skb->csum)) {
303 IP_VS_DBG_RL_PKT(0, pp, skb, 0, 303 IP_VS_DBG_RL_PKT(0, af, pp, skb, 0,
304 "Failed checksum for"); 304 "Failed checksum for");
305 return 0; 305 return 0;
306 } 306 }
@@ -311,7 +311,7 @@ tcp_csum_check(int af, struct sk_buff *skb, struct ip_vs_protocol *pp)
311 skb->len - tcphoff, 311 skb->len - tcphoff,
312 ip_hdr(skb)->protocol, 312 ip_hdr(skb)->protocol,
313 skb->csum)) { 313 skb->csum)) {
314 IP_VS_DBG_RL_PKT(0, pp, skb, 0, 314 IP_VS_DBG_RL_PKT(0, af, pp, skb, 0,
315 "Failed checksum for"); 315 "Failed checksum for");
316 return 0; 316 return 0;
317 } 317 }
diff --git a/net/netfilter/ipvs/ip_vs_proto_udp.c b/net/netfilter/ipvs/ip_vs_proto_udp.c
index 5d21f08155ed..9d106a06bb0a 100644
--- a/net/netfilter/ipvs/ip_vs_proto_udp.c
+++ b/net/netfilter/ipvs/ip_vs_proto_udp.c
@@ -314,7 +314,7 @@ udp_csum_check(int af, struct sk_buff *skb, struct ip_vs_protocol *pp)
314 skb->len - udphoff, 314 skb->len - udphoff,
315 ipv6_hdr(skb)->nexthdr, 315 ipv6_hdr(skb)->nexthdr,
316 skb->csum)) { 316 skb->csum)) {
317 IP_VS_DBG_RL_PKT(0, pp, skb, 0, 317 IP_VS_DBG_RL_PKT(0, af, pp, skb, 0,
318 "Failed checksum for"); 318 "Failed checksum for");
319 return 0; 319 return 0;
320 } 320 }
@@ -325,7 +325,7 @@ udp_csum_check(int af, struct sk_buff *skb, struct ip_vs_protocol *pp)
325 skb->len - udphoff, 325 skb->len - udphoff,
326 ip_hdr(skb)->protocol, 326 ip_hdr(skb)->protocol,
327 skb->csum)) { 327 skb->csum)) {
328 IP_VS_DBG_RL_PKT(0, pp, skb, 0, 328 IP_VS_DBG_RL_PKT(0, af, pp, skb, 0,
329 "Failed checksum for"); 329 "Failed checksum for");
330 return 0; 330 return 0;
331 } 331 }
diff --git a/net/netfilter/ipvs/ip_vs_xmit.c b/net/netfilter/ipvs/ip_vs_xmit.c
index 97b5361c036e..de04ea39cde8 100644
--- a/net/netfilter/ipvs/ip_vs_xmit.c
+++ b/net/netfilter/ipvs/ip_vs_xmit.c
@@ -543,7 +543,8 @@ ip_vs_nat_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
543 struct nf_conn *ct = ct = nf_ct_get(skb, &ctinfo); 543 struct nf_conn *ct = ct = nf_ct_get(skb, &ctinfo);
544 544
545 if (ct && !nf_ct_is_untracked(ct)) { 545 if (ct && !nf_ct_is_untracked(ct)) {
546 IP_VS_DBG_RL_PKT(10, pp, skb, 0, "ip_vs_nat_xmit(): " 546 IP_VS_DBG_RL_PKT(10, AF_INET, pp, skb, 0,
547 "ip_vs_nat_xmit(): "
547 "stopping DNAT to local address"); 548 "stopping DNAT to local address");
548 goto tx_error_put; 549 goto tx_error_put;
549 } 550 }
@@ -552,7 +553,7 @@ ip_vs_nat_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
552 553
553 /* From world but DNAT to loopback address? */ 554 /* From world but DNAT to loopback address? */
554 if (local && ipv4_is_loopback(rt->rt_dst) && skb_rtable(skb)->fl.iif) { 555 if (local && ipv4_is_loopback(rt->rt_dst) && skb_rtable(skb)->fl.iif) {
555 IP_VS_DBG_RL_PKT(1, pp, skb, 0, "ip_vs_nat_xmit(): " 556 IP_VS_DBG_RL_PKT(1, AF_INET, pp, skb, 0, "ip_vs_nat_xmit(): "
556 "stopping DNAT to loopback address"); 557 "stopping DNAT to loopback address");
557 goto tx_error_put; 558 goto tx_error_put;
558 } 559 }
@@ -561,7 +562,8 @@ ip_vs_nat_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
561 mtu = dst_mtu(&rt->dst); 562 mtu = dst_mtu(&rt->dst);
562 if ((skb->len > mtu) && (iph->frag_off & htons(IP_DF))) { 563 if ((skb->len > mtu) && (iph->frag_off & htons(IP_DF))) {
563 icmp_send(skb, ICMP_DEST_UNREACH,ICMP_FRAG_NEEDED, htonl(mtu)); 564 icmp_send(skb, ICMP_DEST_UNREACH,ICMP_FRAG_NEEDED, htonl(mtu));
564 IP_VS_DBG_RL_PKT(0, pp, skb, 0, "ip_vs_nat_xmit(): frag needed for"); 565 IP_VS_DBG_RL_PKT(0, AF_INET, pp, skb, 0,
566 "ip_vs_nat_xmit(): frag needed for");
565 goto tx_error_put; 567 goto tx_error_put;
566 } 568 }
567 569
@@ -593,7 +595,7 @@ ip_vs_nat_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
593 goto tx_error; 595 goto tx_error;
594 } 596 }
595 597
596 IP_VS_DBG_PKT(10, pp, skb, 0, "After DNAT"); 598 IP_VS_DBG_PKT(10, AF_INET, pp, skb, 0, "After DNAT");
597 599
598 /* FIXME: when application helper enlarges the packet and the length 600 /* FIXME: when application helper enlarges the packet and the length
599 is larger than the MTU of outgoing device, there will be still 601 is larger than the MTU of outgoing device, there will be still
@@ -654,7 +656,7 @@ ip_vs_nat_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
654 struct nf_conn *ct = ct = nf_ct_get(skb, &ctinfo); 656 struct nf_conn *ct = ct = nf_ct_get(skb, &ctinfo);
655 657
656 if (ct && !nf_ct_is_untracked(ct)) { 658 if (ct && !nf_ct_is_untracked(ct)) {
657 IP_VS_DBG_RL_PKT(10, pp, skb, 0, 659 IP_VS_DBG_RL_PKT(10, AF_INET6, pp, skb, 0,
658 "ip_vs_nat_xmit_v6(): " 660 "ip_vs_nat_xmit_v6(): "
659 "stopping DNAT to local address"); 661 "stopping DNAT to local address");
660 goto tx_error_put; 662 goto tx_error_put;
@@ -665,7 +667,7 @@ ip_vs_nat_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
665 /* From world but DNAT to loopback address? */ 667 /* From world but DNAT to loopback address? */
666 if (local && skb->dev && !(skb->dev->flags & IFF_LOOPBACK) && 668 if (local && skb->dev && !(skb->dev->flags & IFF_LOOPBACK) &&
667 ipv6_addr_type(&rt->rt6i_dst.addr) & IPV6_ADDR_LOOPBACK) { 669 ipv6_addr_type(&rt->rt6i_dst.addr) & IPV6_ADDR_LOOPBACK) {
668 IP_VS_DBG_RL_PKT(1, pp, skb, 0, 670 IP_VS_DBG_RL_PKT(1, AF_INET6, pp, skb, 0,
669 "ip_vs_nat_xmit_v6(): " 671 "ip_vs_nat_xmit_v6(): "
670 "stopping DNAT to loopback address"); 672 "stopping DNAT to loopback address");
671 goto tx_error_put; 673 goto tx_error_put;
@@ -680,7 +682,7 @@ ip_vs_nat_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
680 skb->dev = net->loopback_dev; 682 skb->dev = net->loopback_dev;
681 } 683 }
682 icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu); 684 icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu);
683 IP_VS_DBG_RL_PKT(0, pp, skb, 0, 685 IP_VS_DBG_RL_PKT(0, AF_INET6, pp, skb, 0,
684 "ip_vs_nat_xmit_v6(): frag needed for"); 686 "ip_vs_nat_xmit_v6(): frag needed for");
685 goto tx_error_put; 687 goto tx_error_put;
686 } 688 }
@@ -706,7 +708,7 @@ ip_vs_nat_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
706 dst_release(&rt->dst); 708 dst_release(&rt->dst);
707 } 709 }
708 710
709 IP_VS_DBG_PKT(10, pp, skb, 0, "After DNAT"); 711 IP_VS_DBG_PKT(10, AF_INET6, pp, skb, 0, "After DNAT");
710 712
711 /* FIXME: when application helper enlarges the packet and the length 713 /* FIXME: when application helper enlarges the packet and the length
712 is larger than the MTU of outgoing device, there will be still 714 is larger than the MTU of outgoing device, there will be still