tcp md5sig: Remove redundant protocol argument.
Protocol is always TCP, so remove useless protocol argument. Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
This commit is contained in:
@@ -95,8 +95,7 @@ static struct tcp_md5sig_key *tcp_v4_md5_do_lookup(struct sock *sk,
|
||||
__be32 addr);
|
||||
static int tcp_v4_do_calc_md5_hash(char *md5_hash, struct tcp_md5sig_key *key,
|
||||
__be32 saddr, __be32 daddr,
|
||||
struct tcphdr *th, int protocol,
|
||||
unsigned int tcplen);
|
||||
struct tcphdr *th, unsigned int tcplen);
|
||||
#endif
|
||||
|
||||
struct inet_hashinfo __cacheline_aligned tcp_hashinfo = {
|
||||
@@ -586,8 +585,7 @@ static void tcp_v4_send_reset(struct sock *sk, struct sk_buff *skb)
|
||||
key,
|
||||
ip_hdr(skb)->daddr,
|
||||
ip_hdr(skb)->saddr,
|
||||
&rep.th, IPPROTO_TCP,
|
||||
arg.iov[0].iov_len);
|
||||
&rep.th, arg.iov[0].iov_len);
|
||||
}
|
||||
#endif
|
||||
arg.csum = csum_tcpudp_nofold(ip_hdr(skb)->daddr,
|
||||
@@ -680,8 +678,7 @@ static void tcp_v4_send_ack(struct tcp_timewait_sock *twsk,
|
||||
key,
|
||||
ip_hdr(skb)->daddr,
|
||||
ip_hdr(skb)->saddr,
|
||||
&rep.th, IPPROTO_TCP,
|
||||
arg.iov[0].iov_len);
|
||||
&rep.th, arg.iov[0].iov_len);
|
||||
}
|
||||
#endif
|
||||
arg.csum = csum_tcpudp_nofold(ip_hdr(skb)->daddr,
|
||||
@@ -1006,7 +1003,7 @@ static int tcp_v4_parse_md5_keys(struct sock *sk, char __user *optval,
|
||||
|
||||
static int tcp_v4_do_calc_md5_hash(char *md5_hash, struct tcp_md5sig_key *key,
|
||||
__be32 saddr, __be32 daddr,
|
||||
struct tcphdr *th, int protocol,
|
||||
struct tcphdr *th,
|
||||
unsigned int tcplen)
|
||||
{
|
||||
struct scatterlist sg[4];
|
||||
@@ -1039,7 +1036,7 @@ static int tcp_v4_do_calc_md5_hash(char *md5_hash, struct tcp_md5sig_key *key,
|
||||
bp->saddr = saddr;
|
||||
bp->daddr = daddr;
|
||||
bp->pad = 0;
|
||||
bp->protocol = protocol;
|
||||
bp->protocol = IPPROTO_TCP;
|
||||
bp->len = htons(tcplen);
|
||||
|
||||
sg_init_table(sg, 4);
|
||||
@@ -1099,7 +1096,7 @@ int tcp_v4_calc_md5_hash(char *md5_hash, struct tcp_md5sig_key *key,
|
||||
struct sock *sk,
|
||||
struct dst_entry *dst,
|
||||
struct request_sock *req,
|
||||
struct tcphdr *th, int protocol,
|
||||
struct tcphdr *th,
|
||||
unsigned int tcplen)
|
||||
{
|
||||
__be32 saddr, daddr;
|
||||
@@ -1115,7 +1112,7 @@ int tcp_v4_calc_md5_hash(char *md5_hash, struct tcp_md5sig_key *key,
|
||||
}
|
||||
return tcp_v4_do_calc_md5_hash(md5_hash, key,
|
||||
saddr, daddr,
|
||||
th, protocol, tcplen);
|
||||
th, tcplen);
|
||||
}
|
||||
|
||||
EXPORT_SYMBOL(tcp_v4_calc_md5_hash);
|
||||
@@ -1166,8 +1163,7 @@ static int tcp_v4_inbound_md5_hash(struct sock *sk, struct sk_buff *skb)
|
||||
genhash = tcp_v4_do_calc_md5_hash(newhash,
|
||||
hash_expected,
|
||||
iph->saddr, iph->daddr,
|
||||
th, sk->sk_protocol,
|
||||
skb->len);
|
||||
th, skb->len);
|
||||
|
||||
if (genhash || memcmp(hash_location, newhash, 16) != 0) {
|
||||
if (net_ratelimit()) {
|
||||
|
Reference in New Issue
Block a user