af_packet: use define instead of constant
Instead of using a hard-coded value for the status variable, it would make the code more readable to use its destined define from linux/if_packet.h. Signed-off-by: daniel.borkmann@tik.ee.ethz.ch Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
bfdc587c5a
commit
9e67030af3
1 changed files with 3 additions and 2 deletions
|
@ -855,7 +855,8 @@ static void prb_fill_vlan_info(struct tpacket_kbdq_core *pkc,
|
||||||
ppd->hv1.tp_vlan_tci = vlan_tx_tag_get(pkc->skb);
|
ppd->hv1.tp_vlan_tci = vlan_tx_tag_get(pkc->skb);
|
||||||
ppd->tp_status = TP_STATUS_VLAN_VALID;
|
ppd->tp_status = TP_STATUS_VLAN_VALID;
|
||||||
} else {
|
} else {
|
||||||
ppd->hv1.tp_vlan_tci = ppd->tp_status = 0;
|
ppd->hv1.tp_vlan_tci = 0;
|
||||||
|
ppd->tp_status = TP_STATUS_AVAILABLE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1951,7 +1952,7 @@ static int tpacket_snd(struct packet_sock *po, struct msghdr *msg)
|
||||||
int tp_len, size_max;
|
int tp_len, size_max;
|
||||||
unsigned char *addr;
|
unsigned char *addr;
|
||||||
int len_sum = 0;
|
int len_sum = 0;
|
||||||
int status = 0;
|
int status = TP_STATUS_AVAILABLE;
|
||||||
int hlen, tlen;
|
int hlen, tlen;
|
||||||
|
|
||||||
mutex_lock(&po->pg_vec_lock);
|
mutex_lock(&po->pg_vec_lock);
|
||||||
|
|
Loading…
Add table
Reference in a new issue