Revert "udp: move udp->no_check6_tx to udp->udp_flags"
This reverts commit 50e41aa9ea
which is
commit a0002127cd746fcaa182ad3386ef6931c37f3bda upstream.
It breaks the Android kernel abi and can be brought back in the future
in an abi-safe way if it is really needed.
Bug: 161946584
Change-Id: Id4970ee363d919a675bf96f4dc367a36a1800a11
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
parent
8806a26646
commit
cef6c6be87
@ -32,7 +32,6 @@ static inline u32 udp_hashfn(const struct net *net, u32 num, u32 mask)
|
||||
|
||||
enum {
|
||||
UDP_FLAGS_CORK, /* Cork is required */
|
||||
UDP_FLAGS_NO_CHECK6_TX, /* Send zero UDP6 checksums on TX? */
|
||||
};
|
||||
|
||||
struct udp_sock {
|
||||
@ -46,7 +45,8 @@ struct udp_sock {
|
||||
|
||||
int pending; /* Any pending frames ? */
|
||||
__u8 encap_type; /* Is this an Encapsulation socket? */
|
||||
unsigned char no_check6_rx:1,/* Allow zero UDP6 checksums on RX? */
|
||||
unsigned char no_check6_tx:1,/* Send zero UDP6 checksums on TX? */
|
||||
no_check6_rx:1,/* Allow zero UDP6 checksums on RX? */
|
||||
encap_enabled:1, /* This socket enabled encap
|
||||
* processing; UDP tunnels and
|
||||
* different encapsulation layer set
|
||||
@ -112,7 +112,7 @@ static inline struct udp_sock *udp_sk(const struct sock *sk)
|
||||
|
||||
static inline void udp_set_no_check6_tx(struct sock *sk, bool val)
|
||||
{
|
||||
udp_assign_bit(NO_CHECK6_TX, sk, val);
|
||||
udp_sk(sk)->no_check6_tx = val;
|
||||
}
|
||||
|
||||
static inline void udp_set_no_check6_rx(struct sock *sk, bool val)
|
||||
@ -120,9 +120,9 @@ static inline void udp_set_no_check6_rx(struct sock *sk, bool val)
|
||||
udp_sk(sk)->no_check6_rx = val;
|
||||
}
|
||||
|
||||
static inline bool udp_get_no_check6_tx(const struct sock *sk)
|
||||
static inline bool udp_get_no_check6_tx(struct sock *sk)
|
||||
{
|
||||
return udp_test_bit(NO_CHECK6_TX, sk);
|
||||
return udp_sk(sk)->no_check6_tx;
|
||||
}
|
||||
|
||||
static inline bool udp_get_no_check6_rx(struct sock *sk)
|
||||
|
@ -2711,7 +2711,7 @@ int udp_lib_setsockopt(struct sock *sk, int level, int optname,
|
||||
break;
|
||||
|
||||
case UDP_NO_CHECK6_TX:
|
||||
udp_set_no_check6_tx(sk, valbool);
|
||||
up->no_check6_tx = valbool;
|
||||
break;
|
||||
|
||||
case UDP_NO_CHECK6_RX:
|
||||
@ -2808,7 +2808,7 @@ int udp_lib_getsockopt(struct sock *sk, int level, int optname,
|
||||
break;
|
||||
|
||||
case UDP_NO_CHECK6_TX:
|
||||
val = udp_get_no_check6_tx(sk);
|
||||
val = up->no_check6_tx;
|
||||
break;
|
||||
|
||||
case UDP_NO_CHECK6_RX:
|
||||
|
@ -1260,7 +1260,7 @@ static int udp_v6_send_skb(struct sk_buff *skb, struct flowi6 *fl6,
|
||||
kfree_skb(skb);
|
||||
return -EINVAL;
|
||||
}
|
||||
if (udp_get_no_check6_tx(sk)) {
|
||||
if (udp_sk(sk)->no_check6_tx) {
|
||||
kfree_skb(skb);
|
||||
return -EINVAL;
|
||||
}
|
||||
@ -1281,7 +1281,7 @@ static int udp_v6_send_skb(struct sk_buff *skb, struct flowi6 *fl6,
|
||||
|
||||
if (is_udplite)
|
||||
csum = udplite_csum(skb);
|
||||
else if (udp_get_no_check6_tx(sk)) { /* UDP csum disabled */
|
||||
else if (udp_sk(sk)->no_check6_tx) { /* UDP csum disabled */
|
||||
skb->ip_summed = CHECKSUM_NONE;
|
||||
goto send;
|
||||
} else if (skb->ip_summed == CHECKSUM_PARTIAL) { /* UDP hardware csum */
|
||||
|
Loading…
Reference in New Issue
Block a user