hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/net/packet/internal.h
....@@ -116,10 +116,9 @@
116116 int copy_thresh;
117117 spinlock_t bind_lock;
118118 struct mutex pg_vec_lock;
119
+ unsigned long flags;
119120 unsigned int running; /* bind_lock must be held */
120
- unsigned int auxdata:1, /* writer must hold sock lock */
121
- origdev:1,
122
- has_vnet_hdr:1,
121
+ unsigned int has_vnet_hdr:1, /* writer must hold sock lock */
123122 tp_loss:1,
124123 tp_tx_has_off:1;
125124 int pressure;
....@@ -144,4 +143,25 @@
144143 return (struct packet_sock *)sk;
145144 }
146145
146
+enum packet_sock_flags {
147
+ PACKET_SOCK_ORIGDEV,
148
+ PACKET_SOCK_AUXDATA,
149
+};
150
+
151
+static inline void packet_sock_flag_set(struct packet_sock *po,
152
+ enum packet_sock_flags flag,
153
+ bool val)
154
+{
155
+ if (val)
156
+ set_bit(flag, &po->flags);
157
+ else
158
+ clear_bit(flag, &po->flags);
159
+}
160
+
161
+static inline bool packet_sock_flag(const struct packet_sock *po,
162
+ enum packet_sock_flags flag)
163
+{
164
+ return test_bit(flag, &po->flags);
165
+}
166
+
147167 #endif