#include "fou_nl.h"
struct fou {
- struct socket *sock;
+ struct sock *sk;
u8 protocol;
u8 flags;
__be16 port;
static bool fou_cfg_cmp(struct fou *fou, struct fou_cfg *cfg)
{
- struct sock *sk = fou->sock->sk;
struct udp_port_cfg *udp_cfg = &cfg->udp_config;
+ struct sock *sk = fou->sk;
if (fou->family != udp_cfg->family ||
fou->port != udp_cfg->local_udp_port ||
static void fou_release(struct fou *fou)
{
list_del(&fou->list);
- udp_tunnel_sock_release(fou->sock->sk);
+ udp_tunnel_sock_release(fou->sk);
kfree_rcu(fou, rcu);
}
fou->family = cfg->udp_config.family;
fou->flags = cfg->flags;
fou->type = cfg->type;
- fou->sock = sock;
+ fou->sk = sk;
memset(&tunnel_cfg, 0, sizeof(tunnel_cfg));
tunnel_cfg.encap_type = 1;
static int fou_fill_info(struct fou *fou, struct sk_buff *msg)
{
- struct sock *sk = fou->sock->sk;
+ struct sock *sk = fou->sk;
- if (nla_put_u8(msg, FOU_ATTR_AF, fou->sock->sk->sk_family) ||
+ if (nla_put_u8(msg, FOU_ATTR_AF, sk->sk_family) ||
nla_put_be16(msg, FOU_ATTR_PORT, fou->port) ||
nla_put_be16(msg, FOU_ATTR_PEER_PORT, sk->sk_dport) ||
nla_put_u8(msg, FOU_ATTR_IPPROTO, fou->protocol) ||
if (nla_put_flag(msg, FOU_ATTR_REMCSUM_NOPARTIAL))
return -1;
- if (fou->sock->sk->sk_family == AF_INET) {
+ if (sk->sk_family == AF_INET) {
if (nla_put_in_addr(msg, FOU_ATTR_LOCAL_V4, sk->sk_rcv_saddr))
return -1;