mirror of
https://github.com/openharmony/kernel_linux_common_modules.git
synced 2026-08-26 17:16:37 -04:00
@@ -34,7 +34,8 @@
|
||||
*/
|
||||
#define NIP_HDR_MAX 24
|
||||
#define NIP_UDP_HDR_LEN 8
|
||||
#define NIP_MIN_MTU (NIP_HDR_MAX + 20) // NewIP hdr + TCP hdr
|
||||
#define NIP_TCP_HDR_LEN 20
|
||||
#define NIP_MIN_MTU (NIP_HDR_MAX + NIP_TCP_HDR_LEN)
|
||||
#define NIP_BYTE_ALIGNMENT 2
|
||||
|
||||
#define NIP_BITMAP_HAVE_MORE_BIT 0x01
|
||||
|
||||
+1
-1
@@ -101,7 +101,7 @@ int nip_rcv(struct sk_buff *skb, struct net_device *dev,
|
||||
|
||||
memset(nipcb(skb), 0, sizeof(struct ninet_skb_parm));
|
||||
offset = nip_hdr_parse(skb->data, skb->len, &niph);
|
||||
if (offset <= 0) {
|
||||
if (offset <= 0 || offset > skb->len) {
|
||||
nip_dbg("check in failure, errcode=%d, Drop a packet (nexthdr=%u, hdr_len=%u)",
|
||||
offset, niph.nexthdr, niph.hdr_len);
|
||||
goto drop;
|
||||
|
||||
@@ -1758,6 +1758,8 @@ static int tcp_nip_rcv(struct sk_buff *skb)
|
||||
nip_dbg("non-four byte alignment, drop skb");
|
||||
goto discard_it;
|
||||
}
|
||||
if (!pskb_may_pull(skb, th->doff * 4))
|
||||
goto discard_it;
|
||||
|
||||
sk = __ninet_lookup_skb(&tcp_hashinfo, skb, __tcp_hdrlen(th),
|
||||
th->source, th->dest, dif, &refcounted);
|
||||
|
||||
+5
-1
@@ -1379,7 +1379,8 @@ static void tcp_nip_dup_ack_retrans(struct sock *sk, const struct sk_buff *skb,
|
||||
*/
|
||||
int mss = tcp_nip_current_mss(sk);
|
||||
struct tcphdr *th = (struct tcphdr *)skb->data;
|
||||
u16 discard_num = htons(th->urg_ptr);
|
||||
u16 discard_num = htons(th->urg_ptr) > PKT_DISCARD_MAX ?
|
||||
0 : htons(th->urg_ptr);
|
||||
u32 last_nip_ssthresh = ntp->nip_ssthresh;
|
||||
|
||||
if (tp->selective_acks[0].end_seq)
|
||||
@@ -1730,6 +1731,9 @@ void tcp_nip_rcv_established(struct sock *sk, struct sk_buff *skb,
|
||||
if (unlikely(!rcu_access_pointer(sk->sk_rx_dst)))
|
||||
inet_csk(sk)->icsk_af_ops->sk_rx_dst_set(sk, skb);
|
||||
|
||||
if (skb->len < (th->doff << 2))
|
||||
return;
|
||||
|
||||
if (!tcp_nip_validate_incoming(sk, skb, th, 1))
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user