aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/bridge/br_input.c6
-rw-r--r--net/key/af_key.c4
-rw-r--r--net/rxrpc/ar-connection.c2
-rw-r--r--net/sunrpc/svcsock.c4
-rw-r--r--net/tipc/msg.h6
5 files changed, 10 insertions, 12 deletions
diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c
index 420bbb9955e9..5c18595b7616 100644
--- a/net/bridge/br_input.c
+++ b/net/bridge/br_input.c
@@ -112,9 +112,9 @@ static int br_handle_local_finish(struct sk_buff *skb)
112 */ 112 */
113static inline int is_link_local(const unsigned char *dest) 113static inline int is_link_local(const unsigned char *dest)
114{ 114{
115 const u16 *a = (const u16 *) dest; 115 __be16 *a = (__be16 *)dest;
116 static const u16 *const b = (const u16 *const ) br_group_address; 116 static const __be16 *b = (const __be16 *)br_group_address;
117 static const u16 m = __constant_cpu_to_be16(0xfff0); 117 static const __be16 m = __constant_cpu_to_be16(0xfff0);
118 118
119 return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | ((a[2] ^ b[2]) & m)) == 0; 119 return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | ((a[2] ^ b[2]) & m)) == 0;
120} 120}
diff --git a/net/key/af_key.c b/net/key/af_key.c
index 0f8304b0246b..7b0a95abe934 100644
--- a/net/key/af_key.c
+++ b/net/key/af_key.c
@@ -2540,7 +2540,7 @@ static int pfkey_migrate(struct sock *sk, struct sk_buff *skb,
2540 sel.proto = pfkey_proto_to_xfrm(sa->sadb_address_proto); 2540 sel.proto = pfkey_proto_to_xfrm(sa->sadb_address_proto);
2541 sel.sport = ((struct sockaddr_in *)(sa + 1))->sin_port; 2541 sel.sport = ((struct sockaddr_in *)(sa + 1))->sin_port;
2542 if (sel.sport) 2542 if (sel.sport)
2543 sel.sport_mask = ~0; 2543 sel.sport_mask = htons(0xffff);
2544 2544
2545 /* set destination address info of selector */ 2545 /* set destination address info of selector */
2546 sa = ext_hdrs[SADB_EXT_ADDRESS_DST - 1], 2546 sa = ext_hdrs[SADB_EXT_ADDRESS_DST - 1],
@@ -2549,7 +2549,7 @@ static int pfkey_migrate(struct sock *sk, struct sk_buff *skb,
2549 sel.proto = pfkey_proto_to_xfrm(sa->sadb_address_proto); 2549 sel.proto = pfkey_proto_to_xfrm(sa->sadb_address_proto);
2550 sel.dport = ((struct sockaddr_in *)(sa + 1))->sin_port; 2550 sel.dport = ((struct sockaddr_in *)(sa + 1))->sin_port;
2551 if (sel.dport) 2551 if (sel.dport)
2552 sel.dport_mask = ~0; 2552 sel.dport_mask = htons(0xffff);
2553 2553
2554 rq = (struct sadb_x_ipsecrequest *)(pol + 1); 2554 rq = (struct sadb_x_ipsecrequest *)(pol + 1);
2555 2555
diff --git a/net/rxrpc/ar-connection.c b/net/rxrpc/ar-connection.c
index 372b24466dc7..d6667f7bc85e 100644
--- a/net/rxrpc/ar-connection.c
+++ b/net/rxrpc/ar-connection.c
@@ -71,7 +71,7 @@ struct rxrpc_conn_bundle *rxrpc_get_bundle(struct rxrpc_sock *rx,
71 struct rb_node *p, *parent, **pp; 71 struct rb_node *p, *parent, **pp;
72 72
73 _enter("%p{%x},%x,%hx,", 73 _enter("%p{%x},%x,%hx,",
74 rx, key_serial(key), trans->debug_id, ntohl(service_id)); 74 rx, key_serial(key), trans->debug_id, ntohs(service_id));
75 75
76 if (rx->trans == trans && rx->bundle) { 76 if (rx->trans == trans && rx->bundle) {
77 atomic_inc(&rx->bundle->usage); 77 atomic_inc(&rx->bundle->usage);
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
index 64b9b8c743c4..12ff5da8160e 100644
--- a/net/sunrpc/svcsock.c
+++ b/net/sunrpc/svcsock.c
@@ -131,13 +131,13 @@ static char *__svc_print_addr(struct sockaddr *addr, char *buf, size_t len)
131 case AF_INET: 131 case AF_INET:
132 snprintf(buf, len, "%u.%u.%u.%u, port=%u", 132 snprintf(buf, len, "%u.%u.%u.%u, port=%u",
133 NIPQUAD(((struct sockaddr_in *) addr)->sin_addr), 133 NIPQUAD(((struct sockaddr_in *) addr)->sin_addr),
134 htons(((struct sockaddr_in *) addr)->sin_port)); 134 ntohs(((struct sockaddr_in *) addr)->sin_port));
135 break; 135 break;
136 136
137 case AF_INET6: 137 case AF_INET6:
138 snprintf(buf, len, "%x:%x:%x:%x:%x:%x:%x:%x, port=%u", 138 snprintf(buf, len, "%x:%x:%x:%x:%x:%x:%x:%x, port=%u",
139 NIP6(((struct sockaddr_in6 *) addr)->sin6_addr), 139 NIP6(((struct sockaddr_in6 *) addr)->sin6_addr),
140 htons(((struct sockaddr_in6 *) addr)->sin6_port)); 140 ntohs(((struct sockaddr_in6 *) addr)->sin6_port));
141 break; 141 break;
142 142
143 default: 143 default:
diff --git a/net/tipc/msg.h b/net/tipc/msg.h
index 35d5ba1d4f42..ce2659836374 100644
--- a/net/tipc/msg.h
+++ b/net/tipc/msg.h
@@ -72,10 +72,8 @@ static inline void msg_set_bits(struct tipc_msg *m, u32 w,
72 u32 pos, u32 mask, u32 val) 72 u32 pos, u32 mask, u32 val)
73{ 73{
74 val = (val & mask) << pos; 74 val = (val & mask) << pos;
75 val = htonl(val); 75 m->hdr[w] &= ~htonl(mask << pos);
76 mask = htonl(mask << pos); 76 m->hdr[w] |= htonl(val);
77 m->hdr[w] &= ~mask;
78 m->hdr[w] |= val;
79} 77}
80 78
81/* 79/*