Skip to content

Commit

Permalink
net: Fix build when CONFIG_INET is not enabled
Browse files Browse the repository at this point in the history
If the kernel is configured with CONFIG_NET, but without CONFIG_INET we
get the following error when building:

sock.c:(.text+0x4c17): undefined reference to `__sk_defer_free_flush'

Lets move __sk_defer_free_flush to sock.c

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
  • Loading branch information
ribalda authored and intel-lab-lkp committed Feb 11, 2022
1 parent 5b91c5c commit f9b7fbd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
14 changes: 14 additions & 0 deletions net/core/sock.c
Expand Up @@ -2058,6 +2058,20 @@ static void __sk_destruct(struct rcu_head *head)
sk_prot_free(sk->sk_prot_creator, sk);
}

void __sk_defer_free_flush(struct sock *sk)
{
struct llist_node *head;
struct sk_buff *skb, *n;

head = llist_del_all(&sk->defer_list);
llist_for_each_entry_safe(skb, n, head, ll_node) {
prefetch(n);
skb_mark_not_on_list(skb);
__kfree_skb(skb);
}
}
EXPORT_SYMBOL(__sk_defer_free_flush);

void sk_destruct(struct sock *sk)
{
bool use_call_rcu = sock_flag(sk, SOCK_RCU_FREE);
Expand Down
14 changes: 0 additions & 14 deletions net/ipv4/tcp.c
Expand Up @@ -1588,20 +1588,6 @@ void tcp_cleanup_rbuf(struct sock *sk, int copied)
tcp_send_ack(sk);
}

void __sk_defer_free_flush(struct sock *sk)
{
struct llist_node *head;
struct sk_buff *skb, *n;

head = llist_del_all(&sk->defer_list);
llist_for_each_entry_safe(skb, n, head, ll_node) {
prefetch(n);
skb_mark_not_on_list(skb);
__kfree_skb(skb);
}
}
EXPORT_SYMBOL(__sk_defer_free_flush);

static void tcp_eat_recv_skb(struct sock *sk, struct sk_buff *skb)
{
__skb_unlink(skb, &sk->sk_receive_queue);
Expand Down

0 comments on commit f9b7fbd

Please sign in to comment.