diff options
Diffstat (limited to 'net')
| -rw-r--r-- | net/tipc/udp_media.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/net/tipc/udp_media.c b/net/tipc/udp_media.c index c9cf2be3674a..b016c011970b 100644 --- a/net/tipc/udp_media.c +++ b/net/tipc/udp_media.c | |||
| @@ -63,7 +63,7 @@ | |||
| 63 | */ | 63 | */ |
| 64 | struct udp_media_addr { | 64 | struct udp_media_addr { |
| 65 | __be16 proto; | 65 | __be16 proto; |
| 66 | __be16 udp_port; | 66 | __be16 port; |
| 67 | union { | 67 | union { |
| 68 | struct in_addr ipv4; | 68 | struct in_addr ipv4; |
| 69 | struct in6_addr ipv6; | 69 | struct in6_addr ipv6; |
| @@ -108,9 +108,9 @@ static int tipc_udp_addr2str(struct tipc_media_addr *a, char *buf, int size) | |||
| 108 | struct udp_media_addr *ua = (struct udp_media_addr *)&a->value; | 108 | struct udp_media_addr *ua = (struct udp_media_addr *)&a->value; |
| 109 | 109 | ||
| 110 | if (ntohs(ua->proto) == ETH_P_IP) | 110 | if (ntohs(ua->proto) == ETH_P_IP) |
| 111 | snprintf(buf, size, "%pI4:%u", &ua->ipv4, ntohs(ua->udp_port)); | 111 | snprintf(buf, size, "%pI4:%u", &ua->ipv4, ntohs(ua->port)); |
| 112 | else if (ntohs(ua->proto) == ETH_P_IPV6) | 112 | else if (ntohs(ua->proto) == ETH_P_IPV6) |
| 113 | snprintf(buf, size, "%pI6:%u", &ua->ipv6, ntohs(ua->udp_port)); | 113 | snprintf(buf, size, "%pI6:%u", &ua->ipv6, ntohs(ua->port)); |
| 114 | else | 114 | else |
| 115 | pr_err("Invalid UDP media address\n"); | 115 | pr_err("Invalid UDP media address\n"); |
| 116 | return 0; | 116 | return 0; |
| @@ -178,8 +178,8 @@ static int tipc_udp_send_msg(struct net *net, struct sk_buff *skb, | |||
| 178 | skb->dev = rt->dst.dev; | 178 | skb->dev = rt->dst.dev; |
| 179 | ttl = ip4_dst_hoplimit(&rt->dst); | 179 | ttl = ip4_dst_hoplimit(&rt->dst); |
| 180 | udp_tunnel_xmit_skb(rt, ub->ubsock->sk, skb, src->ipv4.s_addr, | 180 | udp_tunnel_xmit_skb(rt, ub->ubsock->sk, skb, src->ipv4.s_addr, |
| 181 | dst->ipv4.s_addr, 0, ttl, 0, src->udp_port, | 181 | dst->ipv4.s_addr, 0, ttl, 0, src->port, |
| 182 | dst->udp_port, false, true); | 182 | dst->port, false, true); |
| 183 | #if IS_ENABLED(CONFIG_IPV6) | 183 | #if IS_ENABLED(CONFIG_IPV6) |
| 184 | } else { | 184 | } else { |
| 185 | struct dst_entry *ndst; | 185 | struct dst_entry *ndst; |
| @@ -196,8 +196,8 @@ static int tipc_udp_send_msg(struct net *net, struct sk_buff *skb, | |||
| 196 | ttl = ip6_dst_hoplimit(ndst); | 196 | ttl = ip6_dst_hoplimit(ndst); |
| 197 | err = udp_tunnel6_xmit_skb(ndst, ub->ubsock->sk, skb, | 197 | err = udp_tunnel6_xmit_skb(ndst, ub->ubsock->sk, skb, |
| 198 | ndst->dev, &src->ipv6, | 198 | ndst->dev, &src->ipv6, |
| 199 | &dst->ipv6, 0, ttl, 0, src->udp_port, | 199 | &dst->ipv6, 0, ttl, 0, src->port, |
| 200 | dst->udp_port, false); | 200 | dst->port, false); |
| 201 | #endif | 201 | #endif |
| 202 | } | 202 | } |
| 203 | return err; | 203 | return err; |
| @@ -292,12 +292,12 @@ err: | |||
| 292 | 292 | ||
| 293 | ip4 = (struct sockaddr_in *)&sa_local; | 293 | ip4 = (struct sockaddr_in *)&sa_local; |
| 294 | local->proto = htons(ETH_P_IP); | 294 | local->proto = htons(ETH_P_IP); |
| 295 | local->udp_port = ip4->sin_port; | 295 | local->port = ip4->sin_port; |
| 296 | local->ipv4.s_addr = ip4->sin_addr.s_addr; | 296 | local->ipv4.s_addr = ip4->sin_addr.s_addr; |
| 297 | 297 | ||
| 298 | ip4 = (struct sockaddr_in *)&sa_remote; | 298 | ip4 = (struct sockaddr_in *)&sa_remote; |
| 299 | remote->proto = htons(ETH_P_IP); | 299 | remote->proto = htons(ETH_P_IP); |
| 300 | remote->udp_port = ip4->sin_port; | 300 | remote->port = ip4->sin_port; |
| 301 | remote->ipv4.s_addr = ip4->sin_addr.s_addr; | 301 | remote->ipv4.s_addr = ip4->sin_addr.s_addr; |
| 302 | return 0; | 302 | return 0; |
| 303 | 303 | ||
| @@ -312,13 +312,13 @@ err: | |||
| 312 | return -EINVAL; | 312 | return -EINVAL; |
| 313 | 313 | ||
| 314 | local->proto = htons(ETH_P_IPV6); | 314 | local->proto = htons(ETH_P_IPV6); |
| 315 | local->udp_port = ip6->sin6_port; | 315 | local->port = ip6->sin6_port; |
| 316 | memcpy(&local->ipv6, &ip6->sin6_addr, sizeof(struct in6_addr)); | 316 | memcpy(&local->ipv6, &ip6->sin6_addr, sizeof(struct in6_addr)); |
| 317 | ub->ifindex = ip6->sin6_scope_id; | 317 | ub->ifindex = ip6->sin6_scope_id; |
| 318 | 318 | ||
| 319 | ip6 = (struct sockaddr_in6 *)&sa_remote; | 319 | ip6 = (struct sockaddr_in6 *)&sa_remote; |
| 320 | remote->proto = htons(ETH_P_IPV6); | 320 | remote->proto = htons(ETH_P_IPV6); |
| 321 | remote->udp_port = ip6->sin6_port; | 321 | remote->port = ip6->sin6_port; |
| 322 | memcpy(&remote->ipv6, &ip6->sin6_addr, sizeof(struct in6_addr)); | 322 | memcpy(&remote->ipv6, &ip6->sin6_addr, sizeof(struct in6_addr)); |
| 323 | return 0; | 323 | return 0; |
| 324 | #endif | 324 | #endif |
| @@ -386,7 +386,7 @@ static int tipc_udp_enable(struct net *net, struct tipc_bearer *b, | |||
| 386 | err = -EAFNOSUPPORT; | 386 | err = -EAFNOSUPPORT; |
| 387 | goto err; | 387 | goto err; |
| 388 | } | 388 | } |
| 389 | udp_conf.local_udp_port = local.udp_port; | 389 | udp_conf.local_udp_port = local.port; |
| 390 | err = udp_sock_create(net, &udp_conf, &ub->ubsock); | 390 | err = udp_sock_create(net, &udp_conf, &ub->ubsock); |
| 391 | if (err) | 391 | if (err) |
| 392 | goto err; | 392 | goto err; |
