Commit bc3a334c authored by Richard Alpe's avatar Richard Alpe Committed by David S. Miller

tipc: rename udp_port in struct udp_media_addr

Context implies that port in struct "udp_media_addr" is referring
to a UDP port.
Signed-off-by: default avatarRichard Alpe <richard.alpe@ericsson.com>
Acked-by: default avatarJon Maloy <jon.maloy@ericsson.com>
Acked-by: default avatarYing Xue <ying.xue@windriver.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e9942923
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
*/ */
struct udp_media_addr { struct udp_media_addr {
__be16 proto; __be16 proto;
__be16 udp_port; __be16 port;
union { union {
struct in_addr ipv4; struct in_addr ipv4;
struct in6_addr ipv6; struct in6_addr ipv6;
...@@ -108,9 +108,9 @@ static int tipc_udp_addr2str(struct tipc_media_addr *a, char *buf, int size) ...@@ -108,9 +108,9 @@ static int tipc_udp_addr2str(struct tipc_media_addr *a, char *buf, int size)
struct udp_media_addr *ua = (struct udp_media_addr *)&a->value; struct udp_media_addr *ua = (struct udp_media_addr *)&a->value;
if (ntohs(ua->proto) == ETH_P_IP) if (ntohs(ua->proto) == ETH_P_IP)
snprintf(buf, size, "%pI4:%u", &ua->ipv4, ntohs(ua->udp_port)); snprintf(buf, size, "%pI4:%u", &ua->ipv4, ntohs(ua->port));
else if (ntohs(ua->proto) == ETH_P_IPV6) else if (ntohs(ua->proto) == ETH_P_IPV6)
snprintf(buf, size, "%pI6:%u", &ua->ipv6, ntohs(ua->udp_port)); snprintf(buf, size, "%pI6:%u", &ua->ipv6, ntohs(ua->port));
else else
pr_err("Invalid UDP media address\n"); pr_err("Invalid UDP media address\n");
return 0; return 0;
...@@ -178,8 +178,8 @@ static int tipc_udp_send_msg(struct net *net, struct sk_buff *skb, ...@@ -178,8 +178,8 @@ static int tipc_udp_send_msg(struct net *net, struct sk_buff *skb,
skb->dev = rt->dst.dev; skb->dev = rt->dst.dev;
ttl = ip4_dst_hoplimit(&rt->dst); ttl = ip4_dst_hoplimit(&rt->dst);
udp_tunnel_xmit_skb(rt, ub->ubsock->sk, skb, src->ipv4.s_addr, udp_tunnel_xmit_skb(rt, ub->ubsock->sk, skb, src->ipv4.s_addr,
dst->ipv4.s_addr, 0, ttl, 0, src->udp_port, dst->ipv4.s_addr, 0, ttl, 0, src->port,
dst->udp_port, false, true); dst->port, false, true);
#if IS_ENABLED(CONFIG_IPV6) #if IS_ENABLED(CONFIG_IPV6)
} else { } else {
struct dst_entry *ndst; struct dst_entry *ndst;
...@@ -196,8 +196,8 @@ static int tipc_udp_send_msg(struct net *net, struct sk_buff *skb, ...@@ -196,8 +196,8 @@ static int tipc_udp_send_msg(struct net *net, struct sk_buff *skb,
ttl = ip6_dst_hoplimit(ndst); ttl = ip6_dst_hoplimit(ndst);
err = udp_tunnel6_xmit_skb(ndst, ub->ubsock->sk, skb, err = udp_tunnel6_xmit_skb(ndst, ub->ubsock->sk, skb,
ndst->dev, &src->ipv6, ndst->dev, &src->ipv6,
&dst->ipv6, 0, ttl, 0, src->udp_port, &dst->ipv6, 0, ttl, 0, src->port,
dst->udp_port, false); dst->port, false);
#endif #endif
} }
return err; return err;
...@@ -292,12 +292,12 @@ static int parse_options(struct nlattr *attrs[], struct udp_bearer *ub, ...@@ -292,12 +292,12 @@ static int parse_options(struct nlattr *attrs[], struct udp_bearer *ub,
ip4 = (struct sockaddr_in *)&sa_local; ip4 = (struct sockaddr_in *)&sa_local;
local->proto = htons(ETH_P_IP); local->proto = htons(ETH_P_IP);
local->udp_port = ip4->sin_port; local->port = ip4->sin_port;
local->ipv4.s_addr = ip4->sin_addr.s_addr; local->ipv4.s_addr = ip4->sin_addr.s_addr;
ip4 = (struct sockaddr_in *)&sa_remote; ip4 = (struct sockaddr_in *)&sa_remote;
remote->proto = htons(ETH_P_IP); remote->proto = htons(ETH_P_IP);
remote->udp_port = ip4->sin_port; remote->port = ip4->sin_port;
remote->ipv4.s_addr = ip4->sin_addr.s_addr; remote->ipv4.s_addr = ip4->sin_addr.s_addr;
return 0; return 0;
...@@ -312,13 +312,13 @@ static int parse_options(struct nlattr *attrs[], struct udp_bearer *ub, ...@@ -312,13 +312,13 @@ static int parse_options(struct nlattr *attrs[], struct udp_bearer *ub,
return -EINVAL; return -EINVAL;
local->proto = htons(ETH_P_IPV6); local->proto = htons(ETH_P_IPV6);
local->udp_port = ip6->sin6_port; local->port = ip6->sin6_port;
memcpy(&local->ipv6, &ip6->sin6_addr, sizeof(struct in6_addr)); memcpy(&local->ipv6, &ip6->sin6_addr, sizeof(struct in6_addr));
ub->ifindex = ip6->sin6_scope_id; ub->ifindex = ip6->sin6_scope_id;
ip6 = (struct sockaddr_in6 *)&sa_remote; ip6 = (struct sockaddr_in6 *)&sa_remote;
remote->proto = htons(ETH_P_IPV6); remote->proto = htons(ETH_P_IPV6);
remote->udp_port = ip6->sin6_port; remote->port = ip6->sin6_port;
memcpy(&remote->ipv6, &ip6->sin6_addr, sizeof(struct in6_addr)); memcpy(&remote->ipv6, &ip6->sin6_addr, sizeof(struct in6_addr));
return 0; return 0;
#endif #endif
...@@ -386,7 +386,7 @@ static int tipc_udp_enable(struct net *net, struct tipc_bearer *b, ...@@ -386,7 +386,7 @@ static int tipc_udp_enable(struct net *net, struct tipc_bearer *b,
err = -EAFNOSUPPORT; err = -EAFNOSUPPORT;
goto err; goto err;
} }
udp_conf.local_udp_port = local.udp_port; udp_conf.local_udp_port = local.port;
err = udp_sock_create(net, &udp_conf, &ub->ubsock); err = udp_sock_create(net, &udp_conf, &ub->ubsock);
if (err) if (err)
goto err; goto err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment