Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ipvs: Trivial changes, use compressed IPv6 address in output

Have not converted the proc file output to compressed IPv6 addresses.

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Acked-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>

authored by

Jesper Dangaard Brouer and committed by
Simon Horman
120b9c14 82c93fcc

+11 -11
+1 -1
include/net/ip_vs.h
··· 165 165 int len; 166 166 #ifdef CONFIG_IP_VS_IPV6 167 167 if (af == AF_INET6) 168 - len = snprintf(&buf[*idx], buf_len - *idx, "[%pI6]", 168 + len = snprintf(&buf[*idx], buf_len - *idx, "[%pI6c]", 169 169 &addr->in6) + 1; 170 170 else 171 171 #endif
+1 -1
net/netfilter/ipvs/ip_vs_core.c
··· 1487 1487 if (ic == NULL) 1488 1488 return NF_DROP; 1489 1489 1490 - IP_VS_DBG(12, "Incoming ICMPv6 (%d,%d) %pI6->%pI6\n", 1490 + IP_VS_DBG(12, "Incoming ICMPv6 (%d,%d) %pI6c->%pI6c\n", 1491 1491 ic->icmp6_type, ntohs(icmpv6_id(ic)), 1492 1492 &iph->saddr, &iph->daddr); 1493 1493
+3 -3
net/netfilter/ipvs/ip_vs_proto.c
··· 280 280 if (ih == NULL) 281 281 sprintf(buf, "TRUNCATED"); 282 282 else if (ih->nexthdr == IPPROTO_FRAGMENT) 283 - sprintf(buf, "%pI6->%pI6 frag", &ih->saddr, &ih->daddr); 283 + sprintf(buf, "%pI6c->%pI6c frag", &ih->saddr, &ih->daddr); 284 284 else { 285 285 __be16 _ports[2], *pptr; 286 286 287 287 pptr = skb_header_pointer(skb, offset + sizeof(struct ipv6hdr), 288 288 sizeof(_ports), _ports); 289 289 if (pptr == NULL) 290 - sprintf(buf, "TRUNCATED %pI6->%pI6", 290 + sprintf(buf, "TRUNCATED %pI6c->%pI6c", 291 291 &ih->saddr, &ih->daddr); 292 292 else 293 - sprintf(buf, "%pI6:%u->%pI6:%u", 293 + sprintf(buf, "%pI6c:%u->%pI6c:%u", 294 294 &ih->saddr, ntohs(pptr[0]), 295 295 &ih->daddr, ntohs(pptr[1])); 296 296 }
+1 -1
net/netfilter/ipvs/ip_vs_sched.c
··· 159 159 svc->fwmark, msg); 160 160 #ifdef CONFIG_IP_VS_IPV6 161 161 } else if (svc->af == AF_INET6) { 162 - IP_VS_ERR_RL("%s: %s [%pI6]:%d - %s\n", 162 + IP_VS_ERR_RL("%s: %s [%pI6c]:%d - %s\n", 163 163 svc->scheduler->name, 164 164 ip_vs_proto_name(svc->protocol), 165 165 &svc->addr.in6, ntohs(svc->port), msg);
+5 -5
net/netfilter/ipvs/ip_vs_xmit.c
··· 335 335 local = __ip_vs_is_local_route6(rt); 336 336 if (!((local ? IP_VS_RT_MODE_LOCAL : IP_VS_RT_MODE_NON_LOCAL) & 337 337 rt_mode)) { 338 - IP_VS_DBG_RL("Stopping traffic to %s address, dest: %pI6\n", 338 + IP_VS_DBG_RL("Stopping traffic to %s address, dest: %pI6c\n", 339 339 local ? "local":"non-local", daddr); 340 340 dst_release(&rt->dst); 341 341 return NULL; ··· 343 343 if (local && !(rt_mode & IP_VS_RT_MODE_RDR) && 344 344 !((ort = (struct rt6_info *) skb_dst(skb)) && 345 345 __ip_vs_is_local_route6(ort))) { 346 - IP_VS_DBG_RL("Redirect from non-local address %pI6 to local " 347 - "requires NAT method, dest: %pI6\n", 346 + IP_VS_DBG_RL("Redirect from non-local address %pI6c to local " 347 + "requires NAT method, dest: %pI6c\n", 348 348 &ipv6_hdr(skb)->daddr, daddr); 349 349 dst_release(&rt->dst); 350 350 return NULL; ··· 352 352 if (unlikely(!local && (!skb->dev || skb->dev->flags & IFF_LOOPBACK) && 353 353 ipv6_addr_type(&ipv6_hdr(skb)->saddr) & 354 354 IPV6_ADDR_LOOPBACK)) { 355 - IP_VS_DBG_RL("Stopping traffic from loopback address %pI6 " 356 - "to non-local address, dest: %pI6\n", 355 + IP_VS_DBG_RL("Stopping traffic from loopback address %pI6c " 356 + "to non-local address, dest: %pI6c\n", 357 357 &ipv6_hdr(skb)->saddr, daddr); 358 358 dst_release(&rt->dst); 359 359 return NULL;