Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[AF_PACKET]: Kill CONFIG_PACKET_SOCKET.

Always set, but af_packet.c, not by the Kconfig subsystem, so
just get rid of it.

Signed-off-by: David S. Miller <davem@davemloft.net>

+5 -20
+5 -20
net/packet/af_packet.c
··· 83 83 #include <net/inet_common.h> 84 84 #endif 85 85 86 - #define CONFIG_SOCK_PACKET 1 87 - 88 86 /* 89 87 Assumptions: 90 88 - if device has no dev->hard_header routine, it adds and removes ll header ··· 244 246 245 247 static const struct proto_ops packet_ops; 246 248 247 - #ifdef CONFIG_SOCK_PACKET 248 249 static const struct proto_ops packet_ops_spkt; 249 250 250 251 static int packet_rcv_spkt(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev) ··· 415 418 dev_put(dev); 416 419 return err; 417 420 } 418 - #endif 419 421 420 422 static inline unsigned int run_filter(struct sk_buff *skb, struct sock *sk, 421 423 unsigned int res) ··· 913 917 * Bind a packet socket to a device 914 918 */ 915 919 916 - #ifdef CONFIG_SOCK_PACKET 917 - 918 920 static int packet_bind_spkt(struct socket *sock, struct sockaddr *uaddr, int addr_len) 919 921 { 920 922 struct sock *sk=sock->sk; ··· 935 941 } 936 942 return err; 937 943 } 938 - #endif 939 944 940 945 static int packet_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) 941 946 { ··· 986 993 987 994 if (!capable(CAP_NET_RAW)) 988 995 return -EPERM; 989 - if (sock->type != SOCK_DGRAM && sock->type != SOCK_RAW 990 - #ifdef CONFIG_SOCK_PACKET 991 - && sock->type != SOCK_PACKET 992 - #endif 993 - ) 996 + if (sock->type != SOCK_DGRAM && sock->type != SOCK_RAW && 997 + sock->type != SOCK_PACKET) 994 998 return -ESOCKTNOSUPPORT; 995 999 996 1000 sock->state = SS_UNCONNECTED; ··· 998 1008 goto out; 999 1009 1000 1010 sock->ops = &packet_ops; 1001 - #ifdef CONFIG_SOCK_PACKET 1002 1011 if (sock->type == SOCK_PACKET) 1003 1012 sock->ops = &packet_ops_spkt; 1004 - #endif 1013 + 1005 1014 sock_init_data(sock, sk); 1006 1015 1007 1016 po = pkt_sk(sk); ··· 1016 1027 1017 1028 spin_lock_init(&po->bind_lock); 1018 1029 po->prot_hook.func = packet_rcv; 1019 - #ifdef CONFIG_SOCK_PACKET 1030 + 1020 1031 if (sock->type == SOCK_PACKET) 1021 1032 po->prot_hook.func = packet_rcv_spkt; 1022 - #endif 1033 + 1023 1034 po->prot_hook.af_packet_priv = sk; 1024 1035 1025 1036 if (proto) { ··· 1139 1150 return err; 1140 1151 } 1141 1152 1142 - #ifdef CONFIG_SOCK_PACKET 1143 1153 static int packet_getname_spkt(struct socket *sock, struct sockaddr *uaddr, 1144 1154 int *uaddr_len, int peer) 1145 1155 { ··· 1159 1171 1160 1172 return 0; 1161 1173 } 1162 - #endif 1163 1174 1164 1175 static int packet_getname(struct socket *sock, struct sockaddr *uaddr, 1165 1176 int *uaddr_len, int peer) ··· 1820 1833 #endif 1821 1834 1822 1835 1823 - #ifdef CONFIG_SOCK_PACKET 1824 1836 static const struct proto_ops packet_ops_spkt = { 1825 1837 .family = PF_PACKET, 1826 1838 .owner = THIS_MODULE, ··· 1840 1854 .mmap = sock_no_mmap, 1841 1855 .sendpage = sock_no_sendpage, 1842 1856 }; 1843 - #endif 1844 1857 1845 1858 static const struct proto_ops packet_ops = { 1846 1859 .family = PF_PACKET,