diff options
Diffstat (limited to 'net/ipv4/af_inet.c')
| -rw-r--r-- | net/ipv4/af_inet.c | 18 | 
1 files changed, 10 insertions, 8 deletions
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c index b403499fdabe..20fda8fb8ffd 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c @@ -229,6 +229,7 @@ int inet_listen(struct socket *sock, int backlog)  		err = inet_csk_listen_start(sk, backlog);  		if (err)  			goto out; +		tcp_call_bpf(sk, BPF_SOCK_OPS_TCP_LISTEN_CB, 0, NULL);  	}  	sk->sk_max_ack_backlog = backlog;  	err = 0; @@ -485,8 +486,7 @@ int __inet_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len,  	 *  is temporarily down)  	 */  	err = -EADDRNOTAVAIL; -	if (!net->ipv4.sysctl_ip_nonlocal_bind && -	    !(inet->freebind || inet->transparent) && +	if (!inet_can_nonlocal_bind(net, inet) &&  	    addr->sin_addr.s_addr != htonl(INADDR_ANY) &&  	    chk_addr_ret != RTN_LOCAL &&  	    chk_addr_ret != RTN_MULTICAST && @@ -1384,12 +1384,12 @@ out:  }  EXPORT_SYMBOL(inet_gso_segment); -struct sk_buff **inet_gro_receive(struct sk_buff **head, struct sk_buff *skb) +struct sk_buff *inet_gro_receive(struct list_head *head, struct sk_buff *skb)  {  	const struct net_offload *ops; -	struct sk_buff **pp = NULL; -	struct sk_buff *p; +	struct sk_buff *pp = NULL;  	const struct iphdr *iph; +	struct sk_buff *p;  	unsigned int hlen;  	unsigned int off;  	unsigned int id; @@ -1425,7 +1425,7 @@ struct sk_buff **inet_gro_receive(struct sk_buff **head, struct sk_buff *skb)  	flush = (u16)((ntohl(*(__be32 *)iph) ^ skb_gro_len(skb)) | (id & ~IP_DF));  	id >>= 16; -	for (p = *head; p; p = p->next) { +	list_for_each_entry(p, head, list) {  		struct iphdr *iph2;  		u16 flush_id; @@ -1505,8 +1505,8 @@ out:  }  EXPORT_SYMBOL(inet_gro_receive); -static struct sk_buff **ipip_gro_receive(struct sk_buff **head, -					 struct sk_buff *skb) +static struct sk_buff *ipip_gro_receive(struct list_head *head, +					struct sk_buff *skb)  {  	if (NAPI_GRO_CB(skb)->encap_mark) {  		NAPI_GRO_CB(skb)->flush = 1; @@ -1801,6 +1801,7 @@ static __net_init int inet_init_net(struct net *net)  	 * We set them here, in case sysctl is not compiled.  	 */  	net->ipv4.sysctl_ip_default_ttl = IPDEFTTL; +	net->ipv4.sysctl_ip_fwd_update_priority = 1;  	net->ipv4.sysctl_ip_dynaddr = 0;  	net->ipv4.sysctl_ip_early_demux = 1;  	net->ipv4.sysctl_udp_early_demux = 1; @@ -1882,6 +1883,7 @@ fs_initcall(ipv4_offload_init);  static struct packet_type ip_packet_type __read_mostly = {  	.type = cpu_to_be16(ETH_P_IP),  	.func = ip_rcv, +	.list_func = ip_list_rcv,  };  static int __init inet_init(void)  |