.. | .. |
---|
116 | 116 | int copy_thresh; |
---|
117 | 117 | spinlock_t bind_lock; |
---|
118 | 118 | struct mutex pg_vec_lock; |
---|
| 119 | + unsigned long flags; |
---|
119 | 120 | 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 */ |
---|
123 | 122 | tp_loss:1, |
---|
124 | 123 | tp_tx_has_off:1; |
---|
125 | 124 | int pressure; |
---|
.. | .. |
---|
144 | 143 | return (struct packet_sock *)sk; |
---|
145 | 144 | } |
---|
146 | 145 | |
---|
| 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 | + |
---|
147 | 167 | #endif |
---|