@@ -1709,7 +1709,6 @@ EXPORT_SYMBOL_GPL(sock_map_close);
1709
1709
struct sockmap_link {
1710
1710
struct bpf_link link ;
1711
1711
struct bpf_map * map ;
1712
- enum bpf_attach_type attach_type ;
1713
1712
};
1714
1713
1715
1714
static void sock_map_link_release (struct bpf_link * link )
@@ -1721,7 +1720,7 @@ static void sock_map_link_release(struct bpf_link *link)
1721
1720
goto out ;
1722
1721
1723
1722
WARN_ON_ONCE (sock_map_prog_update (sockmap_link -> map , NULL , link -> prog , link ,
1724
- sockmap_link -> attach_type ));
1723
+ link -> attach_type ));
1725
1724
1726
1725
bpf_map_put_with_uref (sockmap_link -> map );
1727
1726
sockmap_link -> map = NULL ;
@@ -1772,7 +1771,7 @@ static int sock_map_link_update_prog(struct bpf_link *link,
1772
1771
}
1773
1772
1774
1773
ret = sock_map_prog_link_lookup (sockmap_link -> map , & pprog , & plink ,
1775
- sockmap_link -> attach_type );
1774
+ link -> attach_type );
1776
1775
if (ret )
1777
1776
goto out ;
1778
1777
@@ -1817,7 +1816,7 @@ static int sock_map_link_fill_info(const struct bpf_link *link,
1817
1816
u32 map_id = sock_map_link_get_map_id (sockmap_link );
1818
1817
1819
1818
info -> sockmap .map_id = map_id ;
1820
- info -> sockmap .attach_type = sockmap_link -> attach_type ;
1819
+ info -> sockmap .attach_type = link -> attach_type ;
1821
1820
return 0 ;
1822
1821
}
1823
1822
@@ -1828,7 +1827,7 @@ static void sock_map_link_show_fdinfo(const struct bpf_link *link,
1828
1827
u32 map_id = sock_map_link_get_map_id (sockmap_link );
1829
1828
1830
1829
seq_printf (seq , "map_id:\t%u\n" , map_id );
1831
- seq_printf (seq , "attach_type:\t%u\n" , sockmap_link -> attach_type );
1830
+ seq_printf (seq , "attach_type:\t%u\n" , link -> attach_type );
1832
1831
}
1833
1832
1834
1833
static const struct bpf_link_ops sock_map_link_ops = {
@@ -1869,7 +1868,6 @@ int sock_map_link_create(const union bpf_attr *attr, struct bpf_prog *prog)
1869
1868
bpf_link_init (& sockmap_link -> link , BPF_LINK_TYPE_SOCKMAP , & sock_map_link_ops , prog ,
1870
1869
attach_type );
1871
1870
sockmap_link -> map = map ;
1872
- sockmap_link -> attach_type = attach_type ;
1873
1871
1874
1872
ret = bpf_link_prime (& sockmap_link -> link , & link_primer );
1875
1873
if (ret ) {
0 commit comments